|
CodeAve.com - CSS - Basics | |||
|
|
|||
| ID Selector | ||||
|
|
||||
<html> <head> <title>CodeAve.com/CSS - ID Selector</title> <style type="text/css"> <!-- /* All id selectors are defined with a pound symbol (#) before their name */ #red_text { color: #FF0000 } #blue_text { color: #0000FF } #bold_text { font-weight: bold } --> </style> </head> <body bgcolor="#FFFFFF"> <center> <!-- CSS ides can be added to almost any HTML tag --> <div id="red_text">This is red text using <div> tag and the red_text id</div> <span id="blue_text">This is blue text using <span> tag and the blue_text id</span> <p id="bold_text">This is bold text using the <p> tag and the bold_text id</p> <!-- Span will not disturb the flow of your text and you can apply many styles to a sentence --> <span id="blue_text">Blue</span>, <span id="red_text">Red</span> and <span id="bold_text">Bold</span> <p> <!-- CSS ides are an easy way to avoid repetitive font commands inside table rows or cells --> <table border="1" align="center"> <tr> <td id="red_text">Red Text<br> from <td> tag</td> <td id="bold_text">Bold Text <br> from <td> tag</td> </tr> <tr> <td id="blue_text">Blue Text <br> from <tr> tag</td> <td>Plan Text</td> </tr> </table> </center> </body> </html>
|
||||
|
|
||||