Re: opposite of em

Jewett, Jim J / 2004-04-05 21:31:
> Mikko Rantalainen:
>> Orion Adrian / 2004-04-02 20:12:
>>> Jim Jewett:
>>>>It might make more sense to just give em a strength attribute
>>>>which defaults to 1, but can be negative.
> 
>>>strong.  Now you just have one emphasis element that can represent any 
>>>amount of positive or negative emphasis.
> 
>>I second this. Though the "strength" (or whatever the attribute is 
>>called) should definately be *relative*. 
> 
>>The only problem is, how do you make relative strength to work with 
>>CSS? CSS couldn't add the "strength" values of all the element's 
>>ancestors, last time I checked.
> 
> Why not?  Isn't that what it does with fontsize, if you happen to
> always use relative changes?

The difference is that fontsize is set in the CSS in the first 
place. However, the "strength" is *attribute* for the element and 
CSS cascade order says that you have to apply the style according to 
structure and element's attributes. So you have an element with 
structure HTML > BODY > DIV > EM > SPAN > SPAN > EM and its strength 
is 2. Which color the text inside it should be if I have styles

em::strength(2) { color: red; }
em::strength(3) { color: green; }
em::strength(4) { color: blue; }

??

(Suggest another selector if you think there's some better one. I 
definately think that not having to nest EMs to make them stronger 
isn't that bad so to require ::strength pseudo class. The selector 
[strength=2] isn't a good one because that makes the strength 
attribute absolute and the nesting information is lost.)

-- 
Mikko

Received on Monday, 5 April 2004 16:55:34 UTC