PDA

View Full Version : Link Text Colours


mapbuild
03-26-2011, 02:52 PM
Hello all,

I have read and tried a few ways to fix the following problem but to no avail.

When I add a piece of text which I add a link to, it then turns the colour of the text, whilst this is fine during a sentance to highlight that there is a link, I have some titles which I would prefer just to stay black.

Is there anything that I can do to stop the change of colour, note that I don't mind it changing colour once the link has been clicked.

Any help will be much appreciated.

Regards

Phill

for your information the website is www.mapbuild.co.uk (http://www.mapbuild.co.uk)

johnMoss
03-26-2011, 03:41 PM
First question.... Are you familiar with the use of CSS and are you using Dreamweaver as your editor? You can easily create a CSS rule and stipulate exactly what properties you would like these 'a' tags to have.

Hunter86
03-26-2011, 03:41 PM
Hi, you will need to add some styles to your css document.
For instance if you want all the links to look the same through out the site you can just define the styles using
a:link {
}

If you want different links in different sections to differ then you need to become more specific with your style sheet or add some classes for example
if you want the links to not be blue in your right column
<div class="textColRight">

you would style the links within this container like so

.textcColRight a:link {
color:black;

}

hope that helps

Ricky55
03-26-2011, 05:35 PM
Thats actually wrong Hunter, if you use the selector a:link you just style all links in their unclicked state. If you then click on the link and come back to the page the link will return to its unstyled colour its "visited" colour.

To style links all the same you just need

a {

}

only use a:link if you want to specifiy the others for example

a:link
a:visited
a:hover

Hunter86
03-27-2011, 04:40 PM
yep right sorry should of been clearer, and explained in a little more detail that using the selector would only style the links in their unclicked state. But as the OP said they didn't mind the link having a different colour once it had been clicked I just gave an example. Hope I didn't cause any confusion!

I actually learned from your example and never thought of just styling the a element.

cheers

Ricky55
03-27-2011, 06:38 PM
No worries mate I didn't know for long enough.

FethrdWlf
03-27-2011, 07:24 PM
I believe this page can help:
http://www.dreamweaverclub.com/css-multiple-link-styles.php