Forum Moderators: not2easy

Message Too Old, No Replies

strange question, please help

about <a> tag

         

angelsp

4:00 pm on May 30, 2008 (gmt 0)

10+ Year Member



<a href="http://bbs.example.com">bbs.example.com</a>
<a href="http://www.bbs.example.com">bbs.example.com</a>

css

#a:link {
FONT-SIZE: 9pt; COLOR: #000000; TEXT-DECORATION: none
}

#a:hover {
FONT-SIZE: 9pt; COLOR: #660000; TEXT-DECORATION: underline; bgcolor: white
}

why the 1st link can't display properly, which shows underline although I claim TEXT-DECORATION: none . 2nd one is no problem at all.

Do we have to use link address begin with www ?

how to solve the problem please? thank you.

[edited by: SuzyUK at 4:03 pm (utc) on May 30, 2008]
[edit reason] please use example.com [/edit]

SuzyUK

4:08 pm on May 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi angelsp

no you shouldn't need to use www..

you shouln't have the hash '#' before the a though.. it should just be

a:link
or
a:hover

angelsp

4:22 pm on May 30, 2008 (gmt 0)

10+ Year Member



hi, SuzyUK

my mistake, I didn't use # before a.

Have you tried the code on DW.

It gives you different display. For the link bbs.example.com, it has underline for the words bbs.example.com

for the 2nd, with www, it shows that I expected. If I change the 1st link address to [bbs.example.com,...] it shows normal again. I don't know why it is like that, and I hope you can give me a solution and let me know what the problem it is.

I did a screenshot of the result, uploaded to my webaddress, I don't know how to show you, seems forum doesn't allow webaddress.

SuzyUK

4:27 pm on May 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't have DW, but it's showing OK (for both links) in my editor (HTML-Kit).

Is it OK in IE/Firefox, it could just be a DW thing?

as you say we don't do links, so you can send me the link via stickymail if you like.. but if the whole code for the test page is short enough just post it all here.. including doctype etc..

[edited by: SuzyUK at 4:28 pm (utc) on May 30, 2008]

SuzyUK

4:31 pm on May 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ooops hang on.. have you visited either of the links?

could be you need to add a:visited to the a:link rule

a:link, a:visited {}

angelsp

4:45 pm on May 30, 2008 (gmt 0)

10+ Year Member



a little better now, when I add link to text, DW auto underline it, how to remove the underline please?

sorry about the silly question, I am a beginner :)

sgietz

5:04 pm on May 30, 2008 (gmt 0)

10+ Year Member



DW should display it properly. I noticed that you forgot the semicolon in your style. It should be like this:

a:link {font-size: 9pt; color: #000000; text-decoration: none;}
a:visited {font-size: 9pt; color: #000000; text-decoration: none;}
a:hover {font-size: 9pt; color: #660000; text-decoration: underline; bgcolor: white;}

SuzyUK

5:12 pm on May 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



not a silly question, the only silly questions are the ones that are never asked :)

I think it's the

a:visited
link rule, did you see my previous post, .. when I "visit" (click on) the first link I see what you are describing

a:link, a:visited {
font-size: 9pt;
color: #000000;
text-decoration: none;
}

a:hover {
font-size: 9pt;
color: #660000;
text-decoration: underline;
background-color: white;
}

note also bgcolor is not a CSS property, it should be background-color, not that that affects your underlines

the last semi colon as mentioned above (well spotted!) is optional but it's good practice to use it in case you later add more rules

[edited by: SuzyUK at 5:18 pm (utc) on May 30, 2008]

sgietz

5:20 pm on May 30, 2008 (gmt 0)

10+ Year Member



Yikes, I totally missed the bgcolor one, but I noticed the missing semicolon. I guess that means I can't see the big picture, but I pay attention to detail. :)

angelsp

5:47 pm on May 30, 2008 (gmt 0)

10+ Year Member



all sorted, thank you very much for your help. :)