homepage Welcome to WebmasterWorld Guest from 23.20.61.85
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
All my A href links are styles the same.
how to change one?
akmac

10+ Year Member



 
Msg#: 4597800 posted 8:38 pm on Jul 30, 2013 (gmt 0)

I list my toll free number in the header of my site that links to my contact page. Currently, because it is linked, it is subject to this:

A{color:#666;text-decoration:none}
A:hover{color:#999}

How can I make it White all the time, underlined when the cursor hovers over it?

I need to change this one thing without affecting the rest of the linked text.

TYIA!

 

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4597800 posted 8:56 pm on Jul 30, 2013 (gmt 0)

Without seeing the rest of the code I'll have to guess.

Perhaps add a span round the number and add extra CSS to style that span differently?

DrDoc

WebmasterWorld Senior Member drdoc us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4597800 posted 9:09 pm on Jul 30, 2013 (gmt 0)

... or an ID or class name. Really, whatever you choose is fine. You may already be able to target that anchor, if its location is unique.

#someid a {}
#someclass a {}
someelem someelem someelem a {}

akmac

10+ Year Member



 
Msg#: 4597800 posted 9:41 pm on Jul 30, 2013 (gmt 0)

Wow, thanks for the rapid replies! Pardon my newbiness, I'm one of those "screen designers" trying to hack this minor change. How would I implement either the span, ID or Class to the following code on the page?


<td align="right" valign="top"><font style="font-size: 26px; white-space: nowrap; padding-right: 8px; " color="white" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><a title="Contact Us" href="http://learncss.youfool.com" target="_self">1-800-xxx-xxxx</a></td>


I think I can wrangle the changes to the stylesheet.css, but may be back shortly for that. ;-)

lucy24

WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



 
Msg#: 4597800 posted 10:12 pm on Jul 30, 2013 (gmt 0)

I need to change this one thing without affecting the rest of the linked text.

Set a class. If it's currently under generic <a> code than all you need to set is something like

a.special {color: white;}
a.special:hover {et cetera;}

paired with

<a class = "special" href = "/contact et cetera

akmac

10+ Year Member



 
Msg#: 4597800 posted 10:34 pm on Jul 30, 2013 (gmt 0)

Thanks! You guys (and gal) are the best!

JD_Toims

WebmasterWorld Senior Member Top Contributors Of The Month



 
Msg#: 4597800 posted 11:05 pm on Jul 30, 2013 (gmt 0)

<a title="Contact Us" href="http://learncss.youfool.com" target="_self">

Now that's funny!

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4597800 posted 11:22 pm on Jul 30, 2013 (gmt 0)

<a class="special" title="Contact Us" href="http://example.com" target="_self">1-800-xxx-xxxx</a>

That'll do it. Do this in place of the span I suggested.

You'll need a few extra lines in your CSS file to style the "special" class.

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