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