|
Tag Style
Next articles: ID & Class - ID and CLASS are commands used to give a "name" to a certain CSS format. These are used when you want to...
Font Style - These elements are very similar to the FONT tag of HTML3.2. Fonts can be specified by type (family), style...
Text Style - How do you align text and images? How do you specify text colors? What about other text tricks?...
Link Style - You may have noticed some sites have links that change color or do not have an underline below them...
Background Style - Background colors and images can be placed as a main page background, a table or cell background, or even a...
|
CSS tags are also known as elements or selectors. They have a basic layout very similar to regular HTML tags.
| Regular HTML tag |
<tag property="value"> |
| CSS command tag |
element {property: value;} | One of the main differences is the use of the { } brackets instead of the < > brackets. The ELEMENT can be a normal HTML tag, an id, or a class. The PROPERTY and VALUE are the same form as the HTML tags.
Tag Elements Tag elements are very similar to regular HTML tags. Here is an example showing some regular text being formatted in a red color :
| HTML |
<font color="#ff0000"> <p> Red Text </p> </font> |
Red Text |
| HTML4 n CSS |
<p style="color: #ff0000;"> More Red Text </p> |
More Red Text | The outcome is the same. The above example shows how to use the inline style CSS, where the command is actually part of a normal HTML tag. That will help on individual instances, but when you want ALL the text within all <p> area to be red, you can use the embeded style CSS. This places the CSS command into the HEAD area of the code.
| HEAD area |
<style type="text/css"> <!- p {color: #ff0000;} -> </style> |
|
| BODY area |
<p> Yet again </p> Not here <p> and again </p> |
Yet again Not here and again |
All of the text within the <p> tags on that page will be affected by the CSS command, making them red. Any text outside of a <p> area will not be affected.
Article by David Stanley. Visit his site http://www.htmlite.com. Reprinted with permission.
|
Link to this article, just copy and paste following code:
<a href=http://www.torroid.com/article1460.html>Tag Style</a>
|
Article viewed 324 time(s). Read more: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | |