Ticker

6/recent/ticker-posts

Header Ads Widget

Describe About All CSS Selector (Class:9) (WPD)

Hello friends in this blog post we will learn about web page development Describe about (CSS Selector) (CLASS:9) computer engineering students Now lets start.



                         


   CSS SELECTOR

→ A css selector is a pattern to match the elements based on their element name,id,class,attribute and more in an Html document.

→ The associated style rules is applied to the elements that match the selector pattern.


* The Element Selector *

→ The element selector elements based on the element name.

→ Example:

                    p{

                            text-align:center;
                            color:red;

                     }


* The Id Selector *

→ The id selector is used to define style rules for a signal or unique element.

→ The id selector is defined with a hash sign (#) immediately followed by the id value.

→ Example:

<!doctype html>

<html>

<style>

     #para1{

                   text-align:center;

                   color:red;

                 }

</style>

</head>

<body>

         <p id="para1">hello, class9</p>

         <p>This paragraph is not affected by the style</p>

</body>

</html>


* The Class Selector *

→ The class selector is used to selects element with a specific class attribute.

→ To select elements with a specific class,write a period ( . ) character,followed by the name of the class.

→ Example:

 <!doctype html>

<html>

<style>

                .center{

                              text-align:center;

                              color:red;

                            }

</style>

</head>

<body>

               <h1 class="center">Computer Engineering</h1>

               <p class="center">Computer Engineering</p>

</body>

</html>


I hope this blog is helpful for you in another Blog post very interesting for you i will describe about CSS3 Introduction please follow this blog.Thanks for reading my blog #stay safe #stay home #stay healthy #stay cool.


Continue in another blog post so connected this blog for another post

 ***************Thanks for reading my blog**************



                           




  









Post a Comment

0 Comments

DESCRIBE ABOUT ANIMATION (Class:9) (WPD)