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

Home Posts Topics Members FAQ

text decoration inheritance

Hi, I need some help with understanding this piece of css.

<u>This is a <a href="#" style="text-decoration:none ;">hyperlink </a> with
surrounding underlining</u>

From what I understand of css, the styling in <a> should override its
parent. But it doesnt seem to work in this case, the whole sentence is still
underlined even though I have specifically specified no text-decoration. I'm
not saying its wrong but I really cant get my head around to why this is -
is this a case exception?

Btw, this only happens with Gekko (Mozilla) and Opera which follows the W3c
recommednation properly. IE6 seems to render it as I would have expected
(with hyperlinks anyway).

Much appreciated,
Andy
Jul 20 '05 #1
14 6374
Andrew Tang wrote:

<u>This is a <a href="#" style="text-decoration:none ;">hyperlink </a>
with surrounding underlining</u>


Do not use inline-styles!
Instead, use:
a:link, a:visited etc. { text-decoration... }

When you turn off text-decoration, make sure to find a good replacement
(like setting the link-color... and setting the back-color).

Does that solve your problems?
--
Google Blogoscoped
http://blog.outer-court.com
Jul 20 '05 #2
Philipp Lenssen wrote:
Andrew Tang wrote:

<u>This is a <a href="#" style="text-decoration:none ;">hyperlink </a>
with surrounding underlining</u>

When you turn off text-decoration, make sure to find a good replacement
(like setting the link-color... and setting the back-color).


Additionally, don't underline text, which is no link.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

Jul 20 '05 #3
Johannes Koch wrote:
Philipp Lenssen wrote:
Andrew Tang wrote:
>><u>This is a <a href="#"
style="text-decoration:none ;">hyperlink </a>
with surrounding underlining</u>

When you turn off text-decoration, make sure to find a good
replacement (like setting the link-color... and setting the
back-color).


Additionally, don't underline text, which is no link.


Absolutely. The only need for that would be as a reminder in
development stage that this should be a link. Everything that goes live
on the Web should not have underlines for none-links. And then there's
some websites which exactly reverse this approach... oh well.
--
Google Blogoscoped
http://blog.outer-court.com
Jul 20 '05 #4
On Thu, 25 Sep 2003 12:40:52 +0100, "Andrew Tang"
<An*********@ho tmail.com> wrote:
Hi, I need some help with understanding this piece of css.

<u>This is a <a href="#" style="text-decoration:none ;">hyperlink </a> with
surrounding underlining</u>

From what I understand of css, the styling in <a> should override its
parent. But it doesnt seem to work in this case, the whole sentence is still
underlined even though I have specifically specified no text-decoration. I'm
not saying its wrong but I really cant get my head around to why this is -
is this a case exception?

Btw, this only happens with Gekko (Mozilla) and Opera which follows the W3c
recommednati on properly. IE6 seems to render it as I would have expected
(with hyperlinks anyway).


The effect of switching underlining (or anything else) on in HTML and
off in CSS is AFAIK undefined, and consequently browser-dependent. If
you want consistency, use CSS throughout and don't use the HTML <U>
element.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #5
"Philipp Lenssen" <in**@outer-court.com> wrote in message
news:bk******** ****@ID-203055.news.uni-berlin.de...
Andrew Tang wrote:

<u>This is a <a href="#" style="text-decoration:none ;">hyperlink </a>
with surrounding underlining</u>


Do not use inline-styles!
Instead, use:
a:link, a:visited etc. { text-decoration... }

When you turn off text-decoration, make sure to find a good replacement
(like setting the link-color... and setting the back-color).


Sorry about the code, its the 'shorten version' so the page does clearly
define what a hyperlink is and is not. The problem with Mozilla and Opera
(which uses the w3c standard) is that 'Text-decoration: none' does nothing
when the parent has 'text-decoration:unde rline' (which is <u> in this case)
so it doesnt matter if it is inlined or not.

I just dont see why that is, when attributes such as 'background-color',
'color' and 'font-family' does exactly what it suppose to do whereelse
'text-decoration' follows its own rules!

Andy
Jul 20 '05 #6

"Stephen Poley" <sb*****@xs4all .nl> wrote in message
news:op******** *************** *********@4ax.c om...
On Thu, 25 Sep 2003 12:40:52 +0100, "Andrew Tang"
<An*********@ho tmail.com> wrote:

<u>This is a <a href="#" style="text-decoration:none ;">hyperlink </a> with
surrounding underlining</u>


The effect of switching underlining (or anything else) on in HTML and
off in CSS is AFAIK undefined, and consequently browser-dependent. If
you want consistency, use CSS throughout and don't use the HTML <U>
element.


Thanks for you answer but that isnt the problem. The code I given out is the
shorten version, I could have easily written:

<span style="text-decoration:unde rline;">This is a <a href="#"
style="text-decoration:none ;">hyperlink </a> with surrounding
underling</span>

and it still faces the same problem. The hyperlink is -still- underlined
even though I specifically said none so I assume its inheriting for some
reason. I'm trying to make w3c compliant code, thats why I dont understand
why Mozilla and Opera is doing this - so I'm just trying to understand it.

Andy
Jul 20 '05 #7
On Thu, 25 Sep 2003, Johannes Koch wrote:
Additionally, don't underline text, which is no link.


This is a strange idea. Underlining is a valid typographic procedure
that is much older than hyperlinks; underline =|= link.

For example, I need <u>s</u> and <u>z</u> in
http://www.unics.uni-hannover.de/nhtcapri/arabic.html6

Jul 20 '05 #8
Andreas Prilop wrote:
On Thu, 25 Sep 2003, Johannes Koch wrote:
Additionally, don't underline text, which is no link.


This is a strange idea. Underlining is a valid typographic procedure
that is much older than hyperlinks; underline =|= link.


A valid typographic procedure on _paper_. And in many other digital
systems. Even in my email client. It is absolutely not common for
non-links on the Web, and highly confusing. Many metaphors or
approaches for offline-media won't work online. (By the way, this alone
doesn't mean you may _never_ have reason not to underline non-links.)

--
Google Blogoscoped
http://blog.outer-court.com
Jul 20 '05 #9
Andrew Tang wrote:
Hi, I need some help with understanding this piece of css.

<u>This is a <a href="#" style="text-decoration:none ;">hyperlink </a> with
surrounding underlining</u>

From what I understand of css, the styling in <a> should override its
parent. But it doesnt seem to work in this case, the whole sentence is
still underlined even though I have specifically specified no
text-decoration. I'm not saying its wrong but I really cant get my head
around to why this is - is this a case exception?

[snip]

Sort of. Text decoration applies to the whole element including its
children - so the value isn't inherited (and therefore cannot be
overridden) - but still has effect.

The CSS 2 specification isn't very clear on this:

<URL:http://www.w3.org/TR/REC-CSS2/text.html#linin g-striking-props>

However, the CSS 2.1 draft clarifies things, and I believe Mozilla has been
attempting to comply with that recently.

"Text decorations on inline boxes are drawn across the entire element, going
across any descendant elements without paying any attention to their
presence."

-- <URL:http://www.w3.org/TR/CSS21/text.html#linin g-striking-props>
--
Jim Dabell

Jul 20 '05 #10

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

Similar topics

0
1989
by: Quinton | last post by:
I'm running a website that uses CSS to format the text and a CGI program Coranto that icludes news updates via SSI. My problem is that some parts of the CSS don't seem to take effect on the included news. All four link styles are used, and all four work in the included text files. The text styles, on the other hand, seem not to work at all. The text that's part of the actual HTML file is formated according to the CSS codes. However, the...
3
4506
by: Christian Roth | last post by:
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
2
2107
by: george.leithead | last post by:
Hi all, I have a very strange problem! In following Web page (which is generated from a CMS System), the navigation to the left 'dissapears' when you roll the mouse over the links? It does not do this in all browsers either. I have found it to happen in IE 7 and the latest patched IE 6. I have tried to find out the reason, but keep finding strange behaviour! You will see at the bottom of the HTML, I have a comment. If you follow...
12
2618
by: tim | last post by:
I am using foldoutmenu 3 and am having problems with viewing my menus in firefox. On my sub3 menus i have more than one line of text in some places. firefox does not recognise that there is more than one line and the text simply overlaps the sub-menus below it. I thought i had got around this by placing empty 'spacers' like so; oFoldMenu.make('sub3','')//spacer unfortunately, i have just viewed the site in IExplorer and it has added...
13
31428
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one outside of our domain, we get the error.. ** Client found response content type of 'text/html; charset=Windows-1252', but expected 'text/xml' **. We can discover the web service by typing in the url of the asmx so we know the server can 'see' it...
2
16179
by: Francesco Moi | last post by:
Hi. I want to create a link within a H1 text: --- <h1><a href=foo>text</a></h1> --- And I've got (in my CSS) --- h1
7
3970
by: pbd22 | last post by:
Hi. Can somebody tell me how I would go about allowing the user to click on a link to put content in text box A and then another link to put different content in text box A and so on. Finally, when onsubmit is fired, all the content created for each individual link (using the same text box) is sent to SQL Server. How do I reuse the same text box in this manner?
2
7068
by: GloStix | last post by:
For some reason, FF likes to put a black underline on all my buttons. No matter what I do, it has the line I've tried displaying as block and cursor, anything.. Also I've been trying to get it so the entire block is clickable, not just the text. I've sorta got it so it's clickable, just some parts of the button I still can't click on. The website is http://pdhtdev.johnabbott.qc.ca/students/2010/james_mann/portfolio/index.htm The css...
0
10473
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
10249
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...
1
10219
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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
7563
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
5461
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4138
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.