|
You normally use the id attribute to change the style for a specific instance of a tag. This has the same effect as an inline so the only benefit is that you can keep all the style declarations together at the top of the page. This makes it easier to change styles and to keep track of what is going on as you apply styles to your pages. To declare style rules for the id attribute, put the hash sign (#) before the selector. For example: #warning {color:red; text-indent:25px; font-size:12pt;} Add the following HTML to your page: <p id="warning"> ...An indented red warning...</p>
|
More information Use the class attribute as a selector Use the id attribute as a selector Matching attributes and selectors Pseudo classes and elements as selectors |