473,835 Members | 2,322 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 #1
29 49072
jmaxsherkimer said the following on 10/09/2004 23:53:
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.
Yes, but I doubt if it's a good thing to do, since most users expect
links to be underlined (appart for menu's or maybe some other special use).
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,
Works as expected then.
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.
Still expected, since you declared it 3 times as none.
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.
Also expected.
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.


Try this in the head:

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

--
Regards
Harrie
Jul 23 '05 #2
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.
Jul 23 '05 #3
Harrie <di************ ******@hotmail. com> wrote:
a:hover { text-decoration: underline }


This may make _all_ <a> elements (including <a name="...">...</a>
elements) underlined on mouseover, depending on the interpretation of the
:hover pseudoclass in the browser. Using
:link:hover, :visited:hover { text-decoration: underline }
would be safer.

On the other hand, the OP should really first consider whether removing
underline is a good idea in the first place, and decide it is not, and
post CSS questions to c.i.w.a.stylesh eets in future.

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

Jul 23 '05 #4
Neal said the following on 11/09/2004 07:11:
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.


Ah, ok, I wasn't aware of that, thanks for mentioning. The same is true
for <script> I guess (not that I really need it, since I normally use
seperate files)?

--
Regards
Harrie
Jul 23 '05 #5
Jukka K. Korpela said the following on 11/09/2004 09:07:
Harrie <di************ ******@hotmail. com> wrote:
a:hover { text-decoration: underline }
This may make _all_ <a> elements (including <a name="...">...</a>
elements) underlined on mouseover, depending on the interpretation of the
:hover pseudoclass in the browser. Using
:link:hover, :visited:hover { text-decoration: underline }
would be safer.


Thanks, I forgot about that, 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>
On the other hand, the OP should really first consider whether removing
underline is a good idea in the first place, and decide it is not, and
post CSS questions to c.i.w.a.stylesh eets in future.


Yes, my first answer to the OP was about if it was a good idea at all.

c.i.w.a.stylesh eets or one of the JavaScript groups, depending on the
way the OP wants to go. There was a reference why the OP didn't want to
use stylesheets (allthough I interpreted this as "external stylesheets").

--
Regards
Harrie
Jul 23 '05 #6
Harrie said the following on 11/09/2004 13:03:
Neal said the following on 11/09/2004 07:11:
Except leave out the comments - they're useless today. Unless you're
supporting really, really ancient browsers.


Ah, ok, I wasn't aware of that, thanks for mentioning. The same is true
for <script> I guess (not that I really need it, since I normally use
seperate files)?


And another question, is this header still needed when one uses inline
stylesheets?:

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

--
Regards
Harrie
Jul 23 '05 #7
On Sat, 11 Sep 2004 13:03:45 +0200, Harrie
<di************ ******@hotmail. com> wrote:
Neal said the following on 11/09/2004 07:11:


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


Ah, ok, I wasn't aware of that, thanks for mentioning. The same is true
for <script> I guess (not that I really need it, since I normally use
seperate files)?


The comment delimiters shouldn't have been needed during any point in the
last five or so years. Even browsers that aren't scriptable should have
included an understanding of the SCRIPT element when it was formally
introduced in HTML 3.2 in 1997[1].

Also, the type attribute has been required, and the language attribute
deprecated, for a similar length of time, which most people don't seem to
realise[2].

Mike
[1] Granted, SCRIPT, along with STYLE, was just a placeholder, but the
whole point was to prepare browsers to either parse it or ignore it, and
not render it. It should also be noted that the preparation *should* have
occurred at those times, but may not have.
[2] I blame out-of-date online tutorials and old scripting textbooks.
That, and a lack of actually RTFM.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #8
On Sat, 11 Sep 2004 14:01:46 +0200, Harrie
<di************ ******@hotmail. com> wrote:

[snip]
And another question, is this header still needed when one uses inline
stylesheets?:

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


Technically, I suppose it should. Just as

<meta http-equiv="Content-Script-Type" content="text/javascript">

should included when you use intrinsic events. However, I don't think any
browsers actually honour either. But, as it doesn't hurt to include
them[1], I use both (either set on the server or in HEAD).

Mike
[1] Unless someone can cite a browser still in use that chokes on such
headers.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #9
Michael Winter said the following on 11/09/2004 15:39:
On Sat, 11 Sep 2004 13:03:45 +0200, Harrie
<di************ ******@hotmail. com> wrote:
Neal said the following on 11/09/2004 07:11:
[snip]
Except leave out the comments - they're useless today. Unless you're
supporting really, really ancient browsers.


Ah, ok, I wasn't aware of that, thanks for mentioning. The same is
true for <script> I guess (not that I really need it, since I
normally use seperate files)?


The comment delimiters shouldn't have been needed during any point in
the last five or so years.


I read and read and read (books, online tutorials, newsgroups) and still
I'm not up-to-date.
Also, the type attribute has been required, and the language attribute
deprecated, for a similar length of time, which most people don't seem
to realise[2].
[2] I blame out-of-date online tutorials and old scripting textbooks.
That, and a lack of actually RTFM.


<shame mode>Whoops! I always use the style attribute and the few times I
forget it the validator helps me remind it. I totally forgot it when I
posted the answer to the OP. Thanks for correcting me</shame mode>

Also thanks for the answer about the <meta http-equiv ...> question.

--
Regards
Harrie
Jul 23 '05 #10

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

Similar topics

3
3953
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
9189
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
3780
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
1587
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
2030
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
3157
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
10815
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
10526
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
10237
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
9348
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
7770
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
5640
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...
0
5808
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4435
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
3
3094
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.