Forum Moderators: not2easy

Message Too Old, No Replies

Complete Noob - CSS Help Needed!

Changing Hyperlinks Colors

         

Strider30

2:21 am on Feb 8, 2013 (gmt 0)

10+ Year Member



Hi all,

I'm a complete noob when it comes to CSS. Hoping for some help here.

I've got a box with a few hyperlinks that I want to change the color on. Here's the coding that I'm using:

<div class="box">
<left>My Other Sites</left>

<left> <a href="http://www.myotherwebsite.net">Basketball Quotes</a></left>
<left> <a href="http://www.my next website.net">Football Quotes</a></left>
</div>

My question is this: How do I change those links to show as blue? Currently they're gray.

Thanks in advance for your time.

Marshall

2:36 am on Feb 8, 2013 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



.box a {
color: #00f
}
It might, however, be better to assign an id to the <div> to limit the effect to the one <div>, e.g.

#links a {
color: #00f;
}

<div id="links" class="box">
<left>My Other Sites</left>
<left> <a href="http://www.myotherwebsite.net">Basketball Quotes</a></left>
<left> <a href="http://www.my next website.net">Football Quotes</a></left>
</div>

Marshall

Fotiman

2:39 am on Feb 8, 2013 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<left></left> is not a valid HTML element.

Currently they're gray.

Most browsers default to blue links, so you probably have some stylesheet that is defining them to be gray instead. You should look in your existing CSS for something like one of the following:

a { ... }

If you want to target just the links within the div that has class box, you could add the follow to your CSS:

.box a {
color: blue;
}

Note, though, that if you have other style rules that have a greater specificity, then that might over ride this style.