Forum Moderators: mack

Message Too Old, No Replies

Link With No Underline?

How do I make a text link without the underline?

         

midnightscape

5:38 pm on Nov 13, 2003 (gmt 0)

10+ Year Member



I'm a self-taught web designer just slowly trying to learn and want to have a text link without the underline. Can it be done with a style sheet (something else I have yet to learn) or is there an easier (ha) way?

Thank you in advance. Great site for a beginner such as me.

Midnightscape

Birdman

5:44 pm on Nov 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello, welcome to WebmasterWorld!

It's easily done with CSS(style). The CSS is as follows:

a, a:visited
{
text-decoration: none;
}

You can put that snippet in the <head> of your document by simply enclosing it in these tags:

<style type="text/css">
styles here
</style>

Or you can have an external stylesheet and call it from the head of the doc like this:

<link rel="stylesheet" href="/style.css" type="text/css" />

And then save your stylesheet as 'style.css' and do not use the <style> tags.

Sinner_G

5:44 pm on Nov 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi midnightscape

I know of no other was than stylsheets, but it is pretty easy. You just need the following code in the <head> of your page:

<style type="text/css">
a:link { text-decoration:none }
</style>

I would make the link in a different colour than the rest of the text, though. The color can also be defined in the a:link style.

<edit>Too slow, and forgot the visited, too...</edit>

midnightscape

5:47 pm on Nov 13, 2003 (gmt 0)

10+ Year Member



Wow, you guys are fast! Thank you both very much for the responses, I appreciate it.

Midnightscape

Nick_W

6:00 pm on Nov 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Be careful though, start messing with what users expect to see and you could be losing page views and customers.

Nick

Mohamed_E

6:33 pm on Nov 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nick_W is, as usual, right. If you remove the underline you should make sure that it stands out in one way or another. On my site I have:
a {
color:#09c;
text-decoration:none;
font-weight:600;
font-family:verdana, arial, helvetica, sans-serif;
}
a:link {color:#09c;}
a:visited {color:#07a;}
a:hover {background-color:#eee;}
That gives me links in a different color. bold font, and the background changes when the cursor is on the link.

Taken together I feel that these features help me avoid underlined links with less risk of confusing the user.

Hmm ... Just removed the bolding and the links still seem pretty distinguishable to me, and certainly look better.

Interesting, I will do some more experimentation before going live with any changes.

Nick_W

6:36 pm on Nov 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Usability: Redundancy is a Big Factor [webmasterworld.com]

Great post by tedster covering this topic well...

Nick

Mohamed_E

7:50 pm on Nov 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tedster's post is excellent, I remember reading it at the time it was posted and deciding to keep the bolding in place.

You may note that at the end of my previous post I wrote:

Interesting, I will do some more experimentation before going live with any changes.

The reason being that I was not completely satisfied with the distinuguishability, and wanted to fool around with the hover behavior or the background to see if I could improve it. Also the change in color after visiting was much less clear when the bolding was taken away.

midnightscape

8:48 pm on Nov 13, 2003 (gmt 0)

10+ Year Member



Thanks again all of you for all the responses.

What resource can I use to find all the CSS styles
a:link, a:visited, a:hover and so on?

Mohamed_E

9:58 pm on Nov 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Start with Nick_W's outstanding CSS Crash Course [webmasterworld.com], then continue by browsing the CSS Forum's library [webmasterworld.com]. Once done, ask specific questions on the CSS Forum.

Birdman

10:56 pm on Nov 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I also like W3schools CSS Reference [w3schools.com] for quick lookups.

Soso

3:01 pm on Nov 15, 2003 (gmt 0)

10+ Year Member



Hi midnightscape,

In my opinion, unless the non-underlined links are absolutely required by the "artistic" aspect of the design, removing the underlining is a bad idea. Why? Because "to underline" is a standard, and removing it will hurt accessibility. The following article discuss this in more details: [diveintoaccessibility.org ] (btw, the whole website is worth reading for those wanting to improve accessiblity of their websites).

A few days ago, I found a gem of wisdom posted in one forum here: you shouldn't expect, that your visitor will understand ANYTHING on your website. How true! I'm maintaining one non-profit website, and I've got several complaints, that we do not have contact info there. While the truth is, that we display email address in the footer of every page, and there is also the "Contacts" link in the link panel just under the banner. But, the links were not underlined, so I suspect that some people simply did not see them. So - let's say that your average visitor can find, for example, 50% of information on your site. If you remove the link underlining, you will decrease this value even more - you are just making life more difficult for novices who don't know that links may not be underlined, for colorblind people, etc...it's not worth it.

Underlined links are so cool. I love underlined links. Sometimes, I miss them so much, that I have to click that cute "User mode" button in my Opera browser and will abandon your stylesheet completely - I want to see at the *first sight*, what is link and what is not link. Don't touch my link-underlines! ;-)

Soso