By 11/02/2016 14 Comments

Difference Between ID & Class Selector In CSS

  • Css ID selector is denoted by hash (#) symbol.
  • Css Class selector is denoted by dot (.) symbol.
  • Css ID selector is used to select only unique Html element. Each element can have only one ID .
  • Css same Class selector is used to select more than one Html element OR multiple Html elements in a page.
  • Multiple Css classes is used to select same Html element.

Example:

<!Doctype>
<style>
 #my-style { color:red }
.demo-style-one { color:green }
.demo-style-two { text-decoration:underline }
.demo-style-three { font-style:italic }

</style>

<body>
 <b id="my-style">This is tutorialstown.com</b><br>
 <span class="demo-style-one">This is statement 1 with class demo-style-one</span><br>
 <span class="demo-style-one">This is statement 2 also with class demo-style-one</span><br>
 <span class="demo-style-one demo-style-two demo-style-three">This is statement 3 with 3 multiple classes</span>
</body>






Posted in: CSS, HTML, Solutions

Leave your valuable Comment

Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .