Webmaster Sitesi
Türk Webmaster Forumu
Webmaster Sitesi
Geri git   Webmaster Sitesi > Hayat Oyunu > Hayat Burada

What is a CSS Inline Style?

Hayat Burada 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, 10:21
Engineer Resmi
Mühendis ve Seo Danışmanı
5. Rank
 
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
Konu Konu Açan Forum Cevap Son Mesaj
IFRAME - Inline Frame DoRuKaN Hayat Burada 1 20-01-2010 15:30
The STYLE Tag Engineer Hayat Burada 0 24-12-2009 19:34
Your First Style Sheet Using Cascading Style Sheets or CSS Engineer Hayat Burada 0 24-12-2009 08:58
VC MS Style SANALman vBulletin Style 0 23-03-2008 19:37
Inline image nedir? anlamı MaNeX Webmaster Sözlüğü 0 26-02-2008 00:34

Webmastersitesi.com forumunda, içerikler sahiplerince otomatik eklendiği için, yazılar yazanlarının sorumluluğundadır, ihbarda bulunulan içerikler, yöneticiler tarafından 24 saat içinde yayından çıkartılacaktır.
 
© Copyright 2007-2010. Tüm Hakları Saklıdır. Webmaster Sitesi® Forumu.

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 251 252 253 254 255 256 257 258 259