HighDots Forums  

Overriding text-decoration in descendant inlines

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Overriding text-decoration in descendant inlines in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Christian Roth
 
Posts: n/a

Default Overriding text-decoration in descendant inlines - 12-07-2004 , 05:25 PM






What I want:

<p style="text-decoration: line-through">
Stricken
<span style="text-decoration: none">not stricken</span>
</p>

, where "Stricken " should be the only thing that is lined through.

According to CSS2.1, this does not work (and all browsers I tested draw
a line through the complete text of <p>).

How do I override the text-decoration value on the paragraph with a
different value (='none') partially in the flow content, here: the
<span> element?

Regards, Christian.

--
Christian Roth
Email: roth (at) visualclick (dot) de
Mac.Java.Pasta.Sopranosax.Single.

Reply With Quote
  #2  
Old   
Jan Roland Eriksson
 
Posts: n/a

Default Re: Overriding text-decoration in descendant inlines - 12-07-2004 , 06:13 PM






On Tue, 7 Dec 2004 23:25:21 +0100, roth-news01 (AT) visualclick (DOT) de (Christian
Roth) wrote:

Quote:
What I want:

p style="text-decoration: line-through"
Stricken
span style="text-decoration: none">not stricken</span
/p

, where "Stricken " should be the only thing that is lined through.

According to CSS2.1, this does not work (and all browsers I tested draw
a line through the complete text of <p>).

How do I override the text-decoration value on the paragraph with a
different value (='none') partially in the flow content, here: the
span> element?
Seems to me that what you really want is to mark some text as deleted,
why not use the correct markup for that at first? and then go on to
style that part as you want it to show up as deleted text.

<p><del class="deleted-text">Stricken</del>
not stricken</p>

.deleted-text {
visibility:visible; /* for safety against UA stylesheets */
display:inline; /* may not be needed, but for safety still */
text-decoration:line-through;
}

--
Rex




Reply With Quote
  #3  
Old   
Christian Roth
 
Posts: n/a

Default Re: Overriding text-decoration in descendant inlines - 12-08-2004 , 07:21 AM



Jan Roland Eriksson <jrexon (AT) newsguy (DOT) com> wrote:

Quote:
What I want:

p style="text-decoration: line-through"
Stricken
span style="text-decoration: none">not stricken</span
/p

, where "Stricken " should be the only thing that is lined through.

[...]
Seems to me that what you really want is to mark some text as deleted,
why not use the correct markup for that at first? and then go on to
style that part as you want it to show up as deleted text.

p><del class="deleted-text">Stricken</del
not stricken</p

.deleted-text {
visibility:visible; /* for safety against UA stylesheets */
display:inline; /* may not be needed, but for safety still */
text-decoration:line-through;
}
Thanks Jan, I think I (over-)simplified my question, leaving out details
I thought would distract. Actually, I have no control over the markup,
and the style on <p> is a class and not a local override:

<par class="decoratedtext">
Stricken
<span style="text-decoration: none">not stricken</span>
</p>

Also, line-through was just an example, it could have been underline or
overline or whatever. The question is if I can create somehow a
"negative-logic" on the text-decoration property, i.e. have it say "turn
off any decoration for this span-ned inline block". But I think I can't.

The only thing I could do is add an additional 'style' attribute on the
<p>, but it does not actually help: Even if I made this a
"text-decoration: none", I have no hook to turn the decoration on for
the "Stricken" content (i.e. there is no surrounding explicit element).

Regards, Christian.
--
Christian Roth
Email: roth (at) visualclick (dot) de
Mac.Java.Pasta.Sopranosax.Single.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.