Welcome to WebmasterWorld Guest from 54.167.40.25

Forum Moderators: not2easy

Message Too Old, No Replies

Complete Noob - CSS Help Needed!

Changing Hyperlinks Colors

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

New User

joined:Feb 8, 2013
posts: 1
votes: 0


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.
2:36 am on Feb 8, 2013 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 4, 2001
posts:2144
votes: 7


.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
2:39 am on Feb 8, 2013 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts: 4966
votes: 10


<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.