473,830 Members | 1,950 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 49071
Lachlan Hunt <sp***********@ gmail.com> wrote in
news:h2******** *********@news-server.bigpond. net.au:
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.


No...

/* --> */ is not a way to do things. The purpose of these is to keep older
browsers from rendering the markup, or perhaps webmail clients from
rendering CSS markup contained within HTML emails. (I have had a problem
with that before.) If you use /* --> */, the "*/" will be _outside_ the
HTML comment, meaning it will appear in the text of the web page on old,
stupid browsers.
Jul 23 '05 #21
Neal <ne*****@yahoo. com> wrote in news:opsd5cp1nm 6v6656
@news.individua l.net:
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>

Except leave out the comments - they're useless today. Unless you're
supporting really, really ancient browsers.


That's a silly argument. Some people might have a reason to be in a
situation where they can use nothing but these ancient browsers. Maybe
they're poor. Including <!-- and --> does not cause _any_ problems, and
leaving them out doesn't cause any important problems either, and there's
no reason to sabatoge your code just so you can screw over older browsers.
Jul 23 '05 #22
wrjames.remove@ spamOn Tue, 14 Sep 2004, Sam Hughes wrote:
That's a silly argument. Some people might have a reason to be in a
situation where they can use nothing but these ancient browsers.
Pre-HTML3.2 browsers? They're essentially useless nowadays, because
they typically don't support name-based virtual hosts either.
Maybe they're poor.
Then they should run a modern browser like Lynx.
Including <!-- and --> does not cause _any_ problems,


Don't try this with XHTML, children...

Ideally, of course, one would not have <style ...> element content
anyway: it's best delegated to a (cacheable) style file, leaving your
pre-HTML3.2 browsers in peace, and curing the problem that you're
worrying about entirely, without any side-effects.

Jul 23 '05 #23
Jukka K. Korpela said the following on 14/09/2004 22:36:
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


Unfortunately I'm still reading that one and haven't come to chapter 14
yet :(

I read it some time ago on:

http://www.htmlhelp.com/reference/cs....html#inlining

(that's also where I learned to comment out inline styles, but Neal
already pointed out that this is not needed anymore)

--
Regards
Harrie
Jul 23 '05 #24
Sam Hughes said the following on 14/09/2004 22:44:
Lachlan Hunt <sp***********@ gmail.com> wrote in
news:h2******** *********@news-server.bigpond. net.au:
On Sat, 11 Sep 2004 02:31:03 +0200, Harrie
<di********* *********@hotma il.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.


No...

/* --> */ is not a way to do things. The purpose of these is to keep older
browsers from rendering the markup, or perhaps webmail clients from
rendering CSS markup contained within HTML emails. (I have had a problem
with that before.) If you use /* --> */, the "*/" will be _outside_ the
HTML comment, meaning it will appear in the text of the web page on old,
stupid browsers.


Looks to me like you have a very valid point here.

I think for the STYLE attribute the end comment (-->) doesn't have to be
commented out (by //), I probably confused myself with JavaScript.

I don't use inline or embedded styles that much anyway, only sometimes
just for a quick test scenario. And I try to stay away from scripts
altogether.

--
Regards
Harrie
Jul 23 '05 #25
On Sun, 12 Sep 2004 00:49:17 GMT, Lachlan Hunt <sp***********@ gmail.com>
wrote:
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.
Well; the original /background/ of the '<!--' and '//-->' constructs
inside the style element is that the MDO+COM 'prolog' and the COM+MDC
'epilogue' was allowed by CSS in order to allow for a way to 'comment
out' the already CDATA classified content of the STYLE element from
ancient browsers that had no internal knowledge of how to handle an
unknown STYLE element.

This then lead to the idea that since the SGML/CRS standard COM+MDC
string had a special meaning to J(ava)script engines it might be a
"good" idea to hide that one from such engines by the use of an initial
'//' J(ava)script line comment start.

All of this is just "mumbo jumbo" of course, the correct solution to all
"problems" like this is to treat the STYLE element and its attribute
counterpart as "persona non grata" in any www page markup.
However, it's not completely necessary for CSS, since CDO '<!--' and
CDC '-->' are allowed within CSS
Actually there is no such thing as 'CDO' and 'CDC' defined in CSS
formality. What is there is an internal grammar definition of values to
be returned by a CSS parser upon the encounter of the SGML sequences
MDO+COM and COM+MDC.

But note that...

<!-- This is a fully valid HTML (SGML) comment -->

<!--
And this is another fully valid HTML (SGML) comment
--
I can not find that a CSS parser must return CDC for the COM+MDC in the
second comment example, unless its spelled out (in some place I can not
find at the moment) that the same parser must eliminate white space down
to zero.
...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.
The STYLE element content is CDATA per definition.

Following that, the only character sequence you need to watch out for is
'</' i.e. ETAGO in SGML lingo.

Still as per definition; the first occurrence of an ETAGO, inside a
stream of CDATA, terminates the parsers CDATA scanning state and reverts
it back to a PCDATA parsing state.

[...]
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
x:before { content: '<'; }
x:after { content: '>'; }
/*]]>*/--></style>
Thanks for the best illustration I have seen so far as to why XHTML (and
the STYLE element) in its current status shall be shunned by decent www
authors.

P.S. (from SGML and its CRS)

CRS = Concrete Reference Syntax
<! = MDO = Markup Declaration Open = MDC = Markup Declaration Close -- = COM = COMment start/end
< = STAGO = Start TAG Open
</ = ETAGO = End TAG Open = TAGC = TAG Close


CDATA = Character DATA
(data that is not processed by a parser, only scanned for
a first occurrence of ETAGO)

PCDATA = Parsed Character DATA
(data that is processed, as per markup application
requirements, by a parser)

--
Rex
Jul 23 '05 #26
Sam Hughes <hu****@rpi.edu > writes:
Neal <ne*****@yahoo. com> wrote in news:opsd5cp1nm 6v6656
@news.individua l.net:
On Sat, 11 Sep 2004 02:31:03 +0200, Harrie
<di************ ******@hotmail. com> wrote:
<style>
<!--
a { text-decoration: none }
a:hover { text-decoration: underline }
//-->
</style>


Except leave out the comments - they're useless today. Unless you're
supporting really, really ancient browsers.


That's a silly argument. Some people might have a reason to be in a
situation where they can use nothing but these ancient browsers. Maybe


The ancient browsers in question are Netscape 1, Lynx 2-4, and Mosaic.
Possibly IE1 and/or IE2 but I don't have those available to test.

I don't believe any of those browsers see use outside testing
environments any more.

--
Chris
Jul 23 '05 #27
"Alan J. Flavell" <fl*****@ph.gla .ac.uk> writes:
wrjames.remove@ spamOn Tue, 14 Sep 2004, Sam Hughes wrote:
That's a silly argument. Some people might have a reason to be in a
situation where they can use nothing but these ancient browsers.


Pre-HTML3.2 browsers? They're essentially useless nowadays, because
they typically don't support name-based virtual hosts either.


A couple of years ago a friend's NS4 installation broke. The machine
also had IE1 on it. So, "no problem, just use that that to download a
modern browser", I think.

It took absolutely *ages* to find a browser download site that
*didn't* use name-based vhosts. I think eventually I ended up going
away to a more normal internet connection and writing down an FTP
address.

As you say, if anyone is still using IE1, the occasional CSS rule at
the top of pages will be the least of their worries...

--
Chris
Jul 23 '05 #28
Jukka K. Korpela wrote:
Brian wrote:

Harrie wrote:
<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


Right. I was thinking of http specs when I posed my question, but of
course there can be headers other than those listed there. Apologies for
not thinking this through.

--
Brian (remove "invalid" to email me)
http://www.tsmchughs.com/
Jul 23 '05 #29
Chris Morris wrote:
The ancient browsers in question are Netscape 1, Lynx 2-4, and
Mosaic.


Lynx 2-4? The newest version is 2.8.5, isn't it? What's Lynx 4? And why
are you designating new versions "ancient"?

--
Brian (remove "invalid" to email me)
http://www.tsmchughs.com/
Jul 23 '05 #30

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
1586
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
9793
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
10774
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
9315
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
7746
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
6951
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();...
0
5780
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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
3959
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.