![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
I've never seen both style and class used in the same element. Is the common? |
|
Which wins? What happens? |
#2
| |||
| |||
|
|
I've never seen both style and class used in the same element. Is the common? Which wins? What happens? The style attribute has a higher specificity then external style sheets. |
#3
| |||
| |||
|
|
The style attribute has a higher specificity then external style sheets. Not necessarily, ID's in an external stylesheet have a higher specificity than an inline style. |
#4
| |||
| |||
|
|
Style attributes have the same specificity as ids, but are considered to be defined later in the cascade order. |
#5
| |||
| |||
|
|
In the original CSS 2 specification. However, it is changed in the CSS 2 errata, and therefore also in the the CSS2.1 working draft. In these, inline styles have specificity 1,0,0,0 rather than 0,1,0,0 (as #id). |
#6
| |||
| |||
|
|
Insert stock "Why not update the spec at the main page instead of forcing people to read errata!?" rant. |
#7
| |||
| |||
|
|
Dan Langille wrote: I've never seen both style and class used in the same element. Is the common? No, thankfully. The style attribute is nasty. |
#8
| |||
| |||
|
|
Stephen Poley <sbpoley (AT) xs4all (DOT) nl> wrote: No, thankfully. The style attribute is nasty. Why? Let's take a recent example I met: some photos of different sizes to be floated at various places in the text, each photo with a caption. .... |
|
I used to do the same thing, I've moved those widths to an external stylesheet because if an image has a caption wider than the image so that it wraps, I prefer it not to wrap when my external stylesheets are not used (UA not capable of retrieving my external stylesheets, or disabled by the user). |
#9
| |||
| |||
|
|
I used to do the same thing, I've moved those widths to an external stylesheet because if an image has a caption wider than the image so that it wraps, I prefer it not to wrap when my external stylesheets are not used (UA not capable of retrieving my external stylesheets, or disabled by the user). With the consequence that every photo needs its own style in the external stylesheet. Doesn't seem like an attractive option to me. |
#10
| |||
| |||
|
|
Stephen Poley <sbpoley (AT) xs4all (DOT) nl> wrote: I used to do the same thing, I've moved those widths to an external stylesheet because if an image has a caption wider than the image so that it wraps, I prefer it not to wrap when my external stylesheets are not used (UA not capable of retrieving my external stylesheets, or disabled by the user). With the consequence that every photo needs its own style in the external stylesheet. Doesn't seem like an attractive option to me. .x250{width:250px} in an external stylesheet, or style="width:250px" in the markup. Why would the first option be "unattractive"? |
![]() |
| Thread Tools | |
| Display Modes | |
| |