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

What is a CSS Inline Style?

English Webmaster Forum forum başlığına What is a CSS Inline Style? konusunun bir özeti Inline styles are CSS styles that are applied to one element using the style attribute. How to Write an Inline Style 1.Write your style property the same way you would ...
Cevapla
 
  #1  
WS 24-12-2009, 09:21
Engineer Resmi
Mühendis
4. Rank
 
Blog Yazıları: 4
Standart What is a CSS Inline Style?

Inline styles are CSS styles that are applied to one element using the style attribute.

How to Write an Inline Style
1.Write your style property the same way you would in a style sheet. But it needs to be all one line. Separate multiple properties with a semi-colon just as you would in a style sheet.

background:#ccc; color:#fff; border: solid black 1px;

2.Place that line of styles inside the style attribute of the element you want styled.

<p style="background:#ccc; color:#fff; border: solid black 1px;">

Advantages of Inline Styles
Because of the cascade, inline styles have the highest precedence. That means they are going to be applied no matter what. The only styles that have higher precedence than inline styles are user styles applied by the readers themselves. So if you are having trouble getting your changes to apply, you can set an inline style on the element and if it still doesn't display, you know there's something else going on.

Inline styles are easy and quick to add. You don't need to create a whole new document (as with external style sheets) or edit a new element in the head of your document (as with internal style sheets). You just add the style attribute that is valid on nearly every XHTML element.

Disadvantages of Inline Styles
Because they are the most specific in the cascade, they can over-ride things you didn't intend them to.

Inline styles must be applied to every element you want them on. So if you want all your paragraphs to have the font-family "Arial" you have to add an inline style to each <p> tag in your document. This adds both maintenance work for the designer and download time for the reader.

It's impossible to style pseudo-elements and -classes with inline styles. For example, with external and internal style sheets, you can style the visited, hover, active, and link color of an anchor tag. But with an inline style all you can style is the link itself, because that's what the style is on.

I recommend not using inline styles for your Web pages because they cause problems and make the pages a lot more work to maintain. The only time I use them is when I want to check a style quickly during development. Once I've got it looking right for that one element, I move it to my external style sheet.
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
css listeleme özellikleri hakkında yardım ekselans0042 Soru - Cevap 3 17-02-2010 15:40
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: 04:29

 
© 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 250