homepage Welcome to WebmasterWorld Guest from 54.196.189.229
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderator: open

CSS Forum

    
problem with links (CSS)
shazzi




msg:4182561
 4:26 pm on Aug 5, 2010 (gmt 0)

This may sound silly, but i am new to this so be gentle, i am currently having a problem with the links i have created in a html file. i am using an external CSS which i created to change the colour of the links, while the hover and visited aspects work, im having problem changing the actual link colour from the default blue, heres some of the code below,

html part of the code:
<a href="index.html"><style="color: rgb(0, 46, 33);">home</style></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="divider.png" style="width: 1px; height: 20px;" ALIGN=ABSMIDDLE>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="about.html">about</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="divider.png" style="width: 1px; height: 20px;" ALIGN=ABSMIDDLE>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="products.html"><style="color: rgb(0, 46, 33);">products</style></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="divider.png" style="width: 1px; height: 20px;" ALIGN=ABSMIDDLE>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="islam.html"><style="color: rgb(0, 46, 33);">stuff</style></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="divider.png" style="width: 1px; height: 20px;" ALIGN=ABSMIDDLE>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="contacts.html"><style="color: rgb(0, 46, 33);">contacts</style></a>

so basically thats the links and in between each link is an image.

external CSS:
<!--
a {text-decoration:none}
//-->

<style type="text/css">
A:link {color: green}
A:visited {color: green}
A:active {color: none}
A:hover {color: red;}
</style>

and thats it, i cant seem to understand why it wont change colour from the original blue, as i mentioned earlier, hover and visited works, any help is appreciated,

thanks,

 

Major_Payne




msg:4182570
 4:48 pm on Aug 5, 2010 (gmt 0)

For external CSS file, remove ALL html tags and HTML coding. If you are styling the links, remove coding like this:

<style="color: rgb(0, 46, 33);">

You can not style inline CSS like that and it's not needed if you are going to style the links themselves with CSS on an external CSS file.


a:link { color: #0f0; }
a:visited { color: #0f0; }
a:active { text-decoration: none }
a:hover { color: $f00; }

shazzi




msg:4182605
 5:28 pm on Aug 5, 2010 (gmt 0)

thank you very much, it worked like a charm! (i feel very silly... :p)

Major_Payne




msg:4182635
 5:53 pm on Aug 5, 2010 (gmt 0)

LOL Welcome to the "Feeling Silly" Club! I have a life-time membership.

shoppertrip




msg:4182976
 7:18 am on Aug 6, 2010 (gmt 0)

thank you dear it's very useful

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved