473,399 Members | 4,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Overriding text-decoration in descendant inlines

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.
Jul 21 '05 #1
3 4493
saz
In article <1g*********************************@visualclick.d e>, roth-
ne****@visualclick.de says...
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.


Here is the proper way to do this:

<p>
<span style="text-decoration: line-through">Stricken</span>
<span style="text-decoration: none">not stricken</span>
</p>
Jul 21 '05 #2
On Tue, 7 Dec 2004 23:25:21 +0100, ro*********@visualclick.de (Christian
Roth) wrote:
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
Jul 21 '05 #3
Jan Roland Eriksson <jr****@newsguy.com> wrote:
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.
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ali Eghtebas | last post by:
Hi, I have 3 questions regarding the code below: 1) Why can't I trap the KEYDOWN while I can trap KEYUP? 2) Is it correct that I use Return True within the IF-Statement? (I've already read...
8
by: Edward Diener | last post by:
Is it possible for a derived class to override a property and/or event of its base class ?
3
by: Vajira | last post by:
Lets say there is a inheritance heirarchy like this. C3 inherit from C2 and C2 inherit from C1 ( C3 -> C2 -> C1 ). If C1 class has a public virtual member function call 'Remove()', can I limit...
3
by: Amin Sobati | last post by:
Hi, I have two classes. Class2 inhertis Class1: ----------------------------- Public Class Class1 Public Overridable Sub MySub() End Sub End Class Public Class Class2
4
by: RSH | last post by:
How do I go about overriding a Control's OnPaint Method? I would like to prevent a control's color from changing when it is disabled. I have overridden the Form's OnPaint Method but I need to...
4
by: RSH | last post by:
I tried an implementation of overriding a ComboBox control. I am simply trying to avoid it repainting, but I can't seem to get it to work. What am I doing wrong? Please help. Thanks, Ron
0
by: Greg | last post by:
I've made a standard datagrid multi line. However, the mutiple lines of text are only visible when a row is selected. This is a common issue and the solution offered is always to override the...
6
by: Ben | last post by:
I'm having a really hard time trying to figure out how to override the drawing in my class derived from Button. When I set the text property, the drawing seems to be taking place in the set...
10
by: r035198x | last post by:
The Object class has five non final methods namely equals, hashCode, toString, clone, and finalize. These were designed to be overridden according to specific general contracts. Other classes that...
1
by: ashutoshjoshi10 | last post by:
Hi, I am using a Dijit.form.filteringSelect to display values using the dojox.data.QueryReadStore. But, after overriding _filterResponse() to format the data in a Dojo-parsable format, whatever...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.