CSS Pseudo class and Pseudo Element (part-1)

CSS Pseudo class and Pseudo Element (part-1)

 CSS Pseudo class and Pseudo Element (part-1)

Today I will show you another most important topic of CSS. lets see first Example 1

(1) Hover
lets we have a anchor text like this 
CSS Pseudo class and Pseudo Element (part-1)

CSS Pseudo class and Pseudo Element (part-1)
Now see when we took our mouse in anchor text is not hovering
Now we implement Hover in our code
and see what happen
lets start
 
CSS Pseudo class and Pseudo Element (part-1)
and see the result 
CSS Pseudo class and Pseudo Element (part-1)
lets see, when we took our mouse in the anchor text , the text background color change into blue.
not only background we can also change text color  
CSS Pseudo class and Pseudo Element (part-1)
and the result is

 

                                                                                                                      




2: First-letter
Now we see that how to change the first letter
like this

Implement code is
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Document</title>
    <style>
       .ab::first-letter{
            background-color: blue;
            color: yellow;
            font-size: 3rem;
       }
    </style>
</head>
<body>
    <h2 class="ab">This is a CSS Tutorial</h2>
</body>
</html>


Foe more in CSS click here





Post a Comment

0 Comments