Welcome to WebmasterWorld Guest from 54.166.224.46

Forum Moderators: not2easy

Message Too Old, No Replies

problem with links (CSS)

     
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,
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; }
5:28 pm on Aug 5, 2010 (gmt 0)



thank you very much, it worked like a charm! (i feel very silly... :p)
5:53 pm on Aug 5, 2010 (gmt 0)



LOL Welcome to the "Feeling Silly" Club! I have a life-time membership.
7:18 am on Aug 6, 2010 (gmt 0)



thank you dear it's very useful
 

Featured Threads

Hot Threads This Week

Hot Threads This Month