CSS video tutorial – 14 – CSS id selector (hash)

CSS id selector demo: To select tags by their “id attribute value” and apply styles on them we use id selector. Syntax of CSS rule-set / rule: selector { declaration list; } To implement id selector, In place of selector, we write id attribute value preceded by hash(#) symbol. In CSS # symbol indicates ID selector. Syntax of id selector: tagname id=”idattributevalue” #idattributevalue { declaration list; } It selects every html tag which has specified id attribute value and applies styles on them. Example for id selector: h1 id=”solidborder” # solidborder { border: 2px solid red; } It selects every html tag available on the page with a specified id attribute value and applies specified styles on them. You should not specify same id attribute value to more than one tag.

It's only fair to share...Tweet about this on TwitterShare on FacebookShare on TumblrShare on Google+Digg thisShare on LinkedInPin on PinterestShare on VKShare on RedditPrint this pageEmail this to someone
Flattr the authorShare on StumbleUponShare on YummlyBuffer this page

Leave a Reply

Your email address will not be published. Required fields are marked *