Webmaster Sitesi
Geri git   Webmaster Sitesi > Değişik Dillerde Webmaster Sitesi Forumları > English Webmaster Forum

Using Cascading Style Sheets

English Webmaster Forum forum başlığına Using Cascading Style Sheets konusunun bir özeti In a previous article I wrote about what Cascading Style Sheets (CSS) are, and a quick sample of how to use them. In this article, I'll explain the syntax of ...
Cevapla
 
  #1  
WS 24-12-2009, 18:25
Engineer Resmi
Mühendis
4. Rank
 
Blog Yazıları: 4
Standart Using Cascading Style Sheets

In a previous article I wrote about what Cascading Style Sheets (CSS) are, and a quick sample of how to use them. In this article, I'll explain the syntax of style sheets and some of the more commonly used styles.

As I said before, there are three places you can store style information. The syntax is the same for all three, but for clarity, I am only going to discuss styles placed in the <head> of a document.
The Rules

1. All style information should be stored within the <style> and </style> element.
This is how the browsers know that the information is for styles.

2. Always include a type attribute.
This attribute indicates what types of style rules you will be using. The most common type of style rule is CSS, but there are other types (XSL, JSS, and others).

3. Enclose all style rules in comment tags.
This ensures that older browsers will not display the style rules by mistake.

Style rules are comprised of two things, the selector and the declaration.

* selector - The HTML element that will be affected by the rule
* declaration - The specific style calls that will affect the selector

The complete syntax for a style rule is:selector { property : value; }

So, to set all bold text to be the color red, you would write:

b { color: red; }

One of the things that makes CSS so easy to use, is that you can group together components that you would like to have the same style. For example, if you wanted all the H1, H2 and bold text red, you could write:

b {color: red;}
h1 {color: red;}
h2 {color: red;}

But with grouping, you put them all on the same line:

b, h1, h2 {color: red;}

You can also group together rules (separated by a semi-colon ( ). For example, to make all h3 text blue and Arial font, you would write:

h3 {
font-family: Arial;
color: blue;
}

By convention, we put separate rules on separate lines, but this is not required.
Common Styles

Different font attributes are the most commonly used style.

font-family - specifies the font face to be used
You can specify either specific fonts (e.g. Arial) or generic fonts (e.g. sans-serif).

font-size - specifies the size of the text
You can specify a relative size (e.g. +1), absolute size (e.g. 4), the length, or a percentage of the line height.

font-style - specifies whether the text will be displayed italic, oblique, or normal

font-variant - specifies whether the text will be displayed in small caps or normal

font-weight - specifies how light or dark (bold) the text will be

The other most commonly used style is text-decoration. With this tag you can remove the underline from links, put a line through marked out text, or make the text blink.

For example, to remove the underline from anchor text, use the style rule:

a { text-decoration: none;}
WS
Cevapla


Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir)
 
Seçenekler


Benzer Konuları Oku
Konu Konu Açan Forum Cevap Son Mesaj
crwZ - bLacKsTar styLe Crowzer vBulletin 1 12-02-2010 15:04

Bağlantı Kur, Contact, Forum Kullanım Sözleşmesi, Gizlilik ~ siteler hakkında Style By: Powered

Saat: 14:38

 
© Copyright. All Rights Reserved. Webmaster Sitesi, Dünya'nın çeşitli yerlerinden katılan kullanıcılardan oluşmaktadır. Yönetim olarak her konuyu incelesek de bazen gözümüzden kaçabilmektedir. Açılan konularda bir yanlışlık veya yasalara aykırı içerikler görürseniz bu Webmaster Sitesi'nin sorumluluğunda değildir. Bizzat paylaşımı yapan kişi veya kişilerin sorumluluğundadır. Böyle bir durumda Webmaster Sitesi sorumlu tutulamaz, yargılanamaz.

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 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249