473,830 Members | 2,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

link underline and no underline how to?

the site we're working on has some anchor links, you click them they
scroll to the bottom of the page with the answers to the questions
linked on to. is there anyway to make it so that the links are not
underlined when the page loads, when the user moves the mouse over
it's underlined, mouse out no underline. i tried:

<a href="#section1 4" class="drkblue0 8bold"
style="text-decoration:none ">

but that left the underline gone forever, the class there is just for
color, color does not change no need to,

also tried:

<a href="#section1 4" class="drkblue0 8bold"
style="text-decoration:none "
onmouseover="th is.style.textDe coration ='none';"
onmouseout="thi s.style.textDec oration='none'; ">

but this made it so there was no underline all the time, even if mouse
was over the text.

also tried

<a href="#section1 4" class="drkblue0 8bold"
onmouseover="th is.style.textDe coration ='none';"
onmouseout="thi s.style.textDec oration='none'; ">

but with this the line is there when the page loads.

as you can see i'm also not using style sheets to do this, because the
main person who does the styles on the site is out for a while, so we
want to try to avoid messing with this work, is it possible to do this
without style sheets like above, or is style sheets are needed can
someone show how to do it.
Jul 23 '05
29 49070
Neal wrote:
On Sat, 11 Sep 2004 02:31:03 +0200, Harrie
<di************ ******@hotmail. com> wrote:
Try this in the head:

<style>
<!--
a { text-decoration: none }
a:hover { text-decoration: underline }
//-->
</style>

Where you have //-->, it should be /*-->*/ since // is a JavaScript
comment, not a CSS comment. However, it's not completely necessary for
CSS, since CDO '<!--' and CDC '-->' are allowed within CSS, and thus
don't need to be commented out. I think, IIRC, they stand for Comment
Delimiter Open and Close, respectively.
Except leave out the comments - they're useless today. Unless you're
supporting really, really ancient browsers.


Yes, in most cases, they are essentially useless but not always. If the
the style sheet needs to contain either '&' or '<' for whatever reason,
then the comment delimiters are needed, otherwise it will be invalid markup.

eg.
<style type="text/css"><!--
x:before { content: '<'; }
x:after { content: '>'; }
--></style>
(where x is any selector that is valid in that context)

However, if the document is XHTML, then when it is correctly parsed as
XML, instead of tag soup, then all the styles will actually be ignored
since they are part of the comment. Thus, for XHTML, the following
needs to be used:

<style type="text/css"><![CDATA[
x:before { content: '<'; }
x:after { content: '>'; }
]]></style>

But, that will not work for existing tag soup parsers when an XHTML
document is served as text/html. If you are writing XHTML 1.0, and you
are using content negotiation to serve it as application/xhtml+xml or
text/html as required, then in order to handle both situations, you need
to use this slightly more complicated version:

<style type="text/css"><!--/*--><![CDATA[/*><!--*/
x:before { content: '<'; }
x:after { content: '>'; }
/*]]>*/--></style>

That will work for for both HTML and XHTML parsers. Similarly, for
scripts, there is another syntax that needs to be used in the same
situation.

<script type="text/javascript"><!--//--><![CDATA[//><!--
...
//--><!]]></script>

For a better explantation, if that was not good enough, see Hixie’s
XHTML advocacy document:
http://www.hixie.ch/advocacy/xhtml

--
Lachlan Hunt
http://www.lachy.id.au/

Please sp***********@g mail.com
Thank you.
Jul 23 '05 #11
Lachlan Hunt <sp***********@ gmail.com> writes:
<di************ ******@hotmail. com> wrote:
//-->
</style>

Where you have //-->, it should be /*-->*/ since // is a JavaScript
comment, not a CSS comment.


Oh; I thought it was a C++ comment.
Well, actually I thought it was no jolly good comment at all since we're
in an HTML authoring group here.
However, it's not completely necessary
for CSS, since CDO '<!--' and CDC '-->' are allowed within CSS,
Within the STYLE element type, you possibly wanted to say.
and
thus don't need to be commented out. I think, IIRC, they stand for
Comment Delimiter Open and Close, respectively.


s/Delimiter/Declaration

If the content model sees fit.

And yes, it's about the usual voodoo, pardon, bugwards compatibility.
--

Più Cabernet,
meno Internet.
Jul 23 '05 #12
Lachlan Hunt said the following on 12/09/2004 02:49:
Where you have //-->, it should be /*-->*/ since // is a JavaScript
comment, not a CSS comment. However, it's not completely necessary for
CSS, since CDO '<!--' and CDC '-->' are allowed within CSS, and thus
don't need to be commented out. I think, IIRC, they stand for Comment
Delimiter Open and Close, respectively.


Hmmm, I think you're right, but the w3c validator doesn't complain about
it when it's in the <head>. It does if you put it in an external
stylesheet. Is this a bug in the validator or is it simply ignoring
anything between <!-- and -->?

--
Regards
Harrie
Jul 23 '05 #13
Harrie wrote:
Lachlan Hunt said the following on 12/09/2004 02:49:
Where you have //-->, it should be /*-->*/ since // is a JavaScript
comment, not a CSS comment. However, it's not completely necessary
for CSS, since CDO '<!--' and CDC '-->' are allowed within CSS, and
thus don't need to be commented out. I think, IIRC, they stand for
Comment Delimiter Open and Close, respectively.

Hmmm, I think you're right, but the w3c validator doesn't complain about
it when it's in the <head>. It does if you put it in an external
stylesheet. Is this a bug in the validator or is it simply ignoring
anything between <!-- and -->?


Which validator are you referring to? The Markup validator or the CSS
validator? I'll assume both, since I just checked it and neither
complained. It is still valid markup, so the W3C Markup validator will
not find any errors with it, but it is not checking the validity of the
CSS. I believe the CSS validator should find errors with a '//', though
I do not have time to go through the CSS spec to double check. If it's
not allowed within external stylesheets, I would assume the same is true
for internal stylesheets within a <style> element. But, that's more of
a CSS question, which isn't really relevant in ciwah.

--
Lachlan Hunt
http://www.lachy.id.au/

Please sp***********@g mail.com
Thank you.
Jul 23 '05 #14
Eric B. Bednarz wrote:
Where you have //-->, it should be /*-->*/ since // is a JavaScript
comment, not a CSS comment.
Oh; I thought it was a C++ comment.


Yes, it is also, but that's where Java and JavaScript inherited the
comment syntax from.
Well, actually I thought it was no jolly good comment at all since we're
in an HTML authoring group here.


It is relevant as far as using them in HTML to hide comment tags from
script parsers.
However, it's not completely necessary
for CSS, since CDO '<!--' and CDC '-->' are allowed within CSS,


Within the STYLE element type, you possibly wanted to say.


Well, actually, they are valid within any CSS; just not in *all* places
within that CSS. They can be used wherever the CSS tokenization rules
say they're allowed. They just have no purpose within an external
stylesheet, as they are ignored by a CSS parser.

--
Lachlan Hunt
http://www.lachy.id.au/

Please sp***********@g mail.com
Thank you.
Jul 23 '05 #15
Tim
On Sat, 11 Sep 2004 13:31:26 +0200,
Harrie <di************ ******@hotmail. com> posted:
just updated my own stylesheet (I used
a:link, a:visited and a:hover so I got it half right). The same is true
for the first rule I posted, so all should be like this I think?:

<style>
:link, :visited { text-decoration: none }
:link:hover, :visited:hover { text-decoration: underline }
</style>


Personally, I'd do that the other way around. It means that people can
INSTANTLY see where links are and NOT have to go wavering a mouse all over
the damn page to try and find where the links are, but can read the text of
links without underlines getting in the way when they do hover the mouse
over them.

I tend to hide the underlines for print media though, you can't click on a
piece of paper, and few browsers print out a footer showing where the links
would have lead to.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.
Jul 23 '05 #16
Lachlan Hunt said the following on 12/09/2004 04:23:
Harrie wrote:
Hmmm, I think you're right, but the w3c validator doesn't complain
about it when it's in the <head>. It does if you put it in an external
stylesheet. Is this a bug in the validator or is it simply ignoring
anything between <!-- and -->?
Which validator are you referring to? The Markup validator or the CSS
validator? I'll assume both, since I just checked it and neither
complained. It is still valid markup, so the W3C Markup validator will
not find any errors with it, but it is not checking the validity of the


I was referring to the CSS validator, but I checked them both.
CSS. I believe the CSS validator should find errors with a '//', though
I do not have time to go through the CSS spec to double check. If it's
not allowed within external stylesheets, I would assume the same is true
for internal stylesheets within a <style> element. But, that's more of
a CSS question, which isn't really relevant in ciwah.


I have to do some reading on CSS myself, so I'll check it myself. Thanks
for your input on this.

--
Regards
Harrie
Jul 23 '05 #17
Tim said the following on 12/09/2004 07:06:
On Sat, 11 Sep 2004 13:31:26 +0200,
Harrie <di************ ******@hotmail. com> posted:
just updated my own stylesheet (I used
a:link, a:visited and a:hover so I got it half right). The same is true
for the first rule I posted, so all should be like this I think?:

<style>
:link, :visited { text-decoration: none }
:link:hover, :visited:hover { text-decoration: underline }
</style>


Personally, I'd do that the other way around. It means that people can
INSTANTLY see where links are and NOT have to go wavering a mouse all over
the damn page to try and find where the links are, but can read the text of
links without underlines getting in the way when they do hover the mouse
over them.


I agree with you, but the OP asked specifically for this. Jukka and I
already pointed out that this is probabbly not a good idea.

--
Regards
Harrie
Jul 23 '05 #18
Harrie wrote:
is this header still needed when one uses inline
stylesheets?:

<meta http-equiv="Content-Style-Type" content="text/css">


That's a new one by me. Where did you learn about this (pseudo-)header?

--
Brian (remove "invalid" to email me)
http://www.tsmchughs.com/
Jul 23 '05 #19
Brian <us*****@juliet remblay.com.inv alid> wrote:
Harrie wrote:
is this header still needed when one uses inline stylesheets?:

<meta http-equiv="Content-Style-Type" content="text/css">


That's a new one by me. Where did you learn about this (pseudo-)header?


Maybe from the HTML specification?
http://www.w3.org/TR/html4/present/styles.html#h-14.2.1

But I wonder if any browsers or other user agents have ever actually
cared the least about such constructs. After all, they assume CSS (in
some flavor - and you cannot specify the flavor in the media type)
as the style sheet language.

The construct is defined in HTML specs just for theoretical completeness.
Logically, a user agent needs to know what style sheet language is used
in style="..." attributes, so there must be _some_ way to tell the
language. But this doesn't really matter in practice, since CSS has
virtually no competition and is assumed by default.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #20

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

Similar topics

3
3952
by: Jean-Fran?ois Lacrampe | last post by:
Hello, I want to write a _very_ simple text parser that would replace a string like: "This is text with /italics/, *bold* and _underline_." and generate automatically something like this: "This is text with <i>italics</i>, <b>bold</b> and <span
7
3407
by: LRW | last post by:
Below I'll paste my CSS and the HTML in question. But what's happening is, I'm trying to establish a link behavior for a class that's separate from the normal link class. I've established a: 's with no underline and then an underline for hover...but oddly, only ONE link will actually show the underline on hover. All the rest, even with the same HTML, won't pop up an underline. I just don't get it! If I could get any advice I'd really...
2
9188
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display in the status bar 'Symantec Corporation' whenever anyone mouses over (onMouseOver) my image or link OR when one clicks while holding the left mouse down (onClick) on the same image or link. Upon releasing the mouse (onMouseOut), the
6
3779
by: JimO | last post by:
Is there any way to reset a link's state. In other words reset a visited link to an unvisited link. I guess the question I'm asking would be how do you programatically search and clear the history of a particular page?
3
3829
by: shapper | last post by:
Hello, How to make the underline of a link to be a dotted line like in this web site: http://www.iconbuffet.com/ Thanks, Miguel
6
1585
by: shyamg | last post by:
hi i given a link in jsp how to use links for with out under line in Mozill Firefox
4
8529
by: Mr. Newt | last post by:
Hi y'all, I'm looking to put an underline under some links but not under others. I still want an underline when the link is hovered over. I've dabbled with classes for this, but all I can get is line or no line. Any help? Thanks.
14
2028
by: Daniel Kaplan | last post by:
So my style sheet has many different types of LINK styles. And they all work fine on IE, even different styles on the same page. But in Firefox, all link throughout my site all follow JUST the first link class on any page. Any thoughts? As a side thought, in my style sheet I changed what I guess was the "Default" link style (as seen below). Was I wrong in doing that?
10
3156
by: JD | last post by:
I've seen websites where the link underline is a different colour to the link text. I've also seen links with dotted underlines (see the hover effect on the 'Change' and 'All Microsoft Sites' links at the top right of this page for an example: http://support.microsoft.com/kb/253503). Do these techniques involve background image/border hacks or can it be done by directly styling the underline using CSS? Thanks
0
9791
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
9642
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
10771
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
10487
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
7745
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
6950
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();...
1
4411
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
3958
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3076
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.