-
Add smooth scrolling
When you scroll a HTML page, it may look weird, fast, or unresponsive to your scrolling By just adding this line of code to your CSS, your HTML page will scroll smoother. Additionally, anchor-links like
<a href="#Hyperlink"> Clik me Anchor Link
will automatically give a smooth scrolling effect, almost like you're manually scrolling down to a certain HTML element. So here's the CSS code for smooth scrolling:
</a> <aside>Some content here......</aside> <p id="Hyperlink"> Here's the Anchor Link <p> element </p>
-
Animations
If you've seen my website (you obviously have) you might've noticed that there are animations in it. Animations are actually pretty easy to implement in CSS. All that you have to do is use the
@Keyframes
rule and implement it in an element. Here's my sample@Keyframes
ruleNow, all you have to do is implement it in an element using the shorthand animation property or using the individual animation-name:/*insert animation-name*/;
animation-duration:/*insert animation-duration*/;
animation-timing-function:/*insert timing function*/;
animation-delay:/*insert animation-delay*/;
properties. So here's my sample code-
Now, if you hover your mouse over button below or click it (on mobiles and tablets), the animation will happen.
-
Syntax Highlighting
If you've read my blogs, you might've seen that that the code is colored based on syntax. Now, doing this by individually coloring each word, is quite tedious. You can use JavaScript libraries like Highlight.js but there is an easier way to do it. I personally use CodeBeautify's syntax highlighter which has auto language detection and a vast variety of themes. I personaly use OneDark and GitHub themes.
-
Text gradients
If you noticed, all the headings have a Gradient. It is easy to make a text gradient in CSS with only 3 lines of code (5 if you include the class name and semicolons)
-
Using My Stylesheet
If you like my website and would like to use similar styles, you can
- Check out the source code by pressing F12 or CTRL + SHIFT + I (⌘ + ⌥ + I on Mac)
-
Use my stylesheet by adding
<link rel= "stylesheet" href="https://ishaant.com/mycss.css?v2.2">
<head>
of your HTML.