homepage Welcome to WebmasterWorld Guest from 54.167.75.155
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Complete Noob - CSS Help Needed!
Changing Hyperlinks Colors
Strider30




msg:4543678
 2:21 am on Feb 8, 2013 (gmt 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.

 

Marshall




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

.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




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

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

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