473,799 Members | 2,941 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Sing le.
Jul 21 '05 #1
3 4506
saz
In article <1g************ *************** ******@visualcl ick.de>, roth-
ne****@visualcl ick.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">Strick en</span>
<span style="text-decoration: none">not stricken</span>
</p>
Jul 21 '05 #2
On Tue, 7 Dec 2004 23:25:21 +0100, ro*********@vis ualclick.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:visi ble; /* 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:visi ble; /* 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="decorate dtext">
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.Sing le.
Jul 21 '05 #4

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

Similar topics

3
4200
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 the documentation but it is rather hard to understand so please don't refer to it :) 3) Many examples in the newsgroups use Return MyBase.ProcessKeyPreview(m) as the last code line while I have used Return MyBase.ProcessKeyEventArgs(m)
8
2267
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
1271
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 overriding this member in C3 class ?
3
1558
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
4681
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 do it at the control level. Thanks, Ron
4
3722
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
1115
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 painttext method, or even the paint method. However, I can't find any tips for going about this. I am already overriding my paint method for the text columns (to add other functionality) , so I know I don't have to add too much more. Anybody got...
6
4586
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 method. I try to override OnPaint and VS never even stops on my OnPaint breakpoint. I try overriding set, but I have no idea how to get the Graphics object from the control. I'm trying to develop games for Windows Mobile 5.x, and it won't let me...
10
105204
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 make use of these methods assume that the methods obey these contracts so it is necessary to ensure that if your classes override these methods, they do so correctly. In this article I'll take a look at the equals and hashCode methods. ...
1
3321
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 value I select gets bypassed and the only value that gets selected is the the first one on the list. I am using the following code…please let me know if what I am missing here. Thanks much in advance! <html> <head> ...
0
9686
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9540
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10475
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10250
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10026
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7564
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.