Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > CSS question

CSS question
Thread Tools
Forum Regular
Join Date: Nov 2001
Status: Offline
Reply With Quote
Mar 1, 2003, 01:03 AM
 
Not even sure how to ask this but can I specify which links css is applied to?

For example this is what I have for:

A:hover
{
color: #333333;
font-family: Verdana, Arial, Helvetica,
font-size: 10px;
font-weight: bold;
background-color: #FFFFFF;
}

The problem is in Safari this places a white line under any image I have set as a link. It doesn't seem to do this in any other browser.

Is there any way I can remove this css attribute from the images but leave it for all other links?
     
Mac Elite
Join Date: Feb 2003
Location: columbus, oh
Status: Offline
Reply With Quote
Mar 1, 2003, 01:10 AM
 
Answer taken from here:

Code:
.speciallink { font-family: verdana, arial, helvetica, sans-serif; color: #000000; } .speciallink A:link { color: #0099FF; text-decoration: none; } .speciallink A:visited { color: #9933FF; text-decoration: none; } .speciallink A:hover { color: #CC0000; text-decoration: underline; }
Then, to apply:
Code:
[p class="speciallink"][a href="http://www.website.com/"]text to be linked[/a][/p]
Just replace '[' ']' with the '<' and '>' tags.
"Another classic science-fiction show cancelled before its time" ~ Bender

15.2" PowerBook 1.25GHz, 80GB HD, 768MB RAM, SuperDrive
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Mar 1, 2003, 08:46 AM
 
Originally posted by motoyen:
Is there any way I can remove this css attribute from the images but leave it for all other links?
adding border="0" should cancel that out. were you not adding that to your linked images?
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Mar 1, 2003, 08:55 AM
 
The advice Optimus gave will work, but there's a better way to do it. Instead of using:
Code:
.speciallink a:link
use:
Code:
a.speciallink:link
Then, you put the class attribute directly on the A tags, rather than wrapping them in a P tag. That'll cut down on page size a bit.
Code:
<.a href="blah" class="speciallink">
(remove the dot at the beginning of the tag, of course.)
The problem is in Safari this places a white line under any image I have set as a link. It doesn't seem to do this in any other browser.

Is there any way I can remove this css attribute from the images but leave it for all other links?
That shows up only in Safari v62, and is a bug in that browser. Hyatt has noted that it has already been fixed for the next public release. So I wouldn't worry about it for now.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Senior User
Join Date: Dec 2002
Status: Offline
Reply With Quote
Mar 1, 2003, 11:27 AM
 
there needs to be more css talk in here! good stuff
Nothing is older than the idea of new

     
motoyen  (op)
Forum Regular
Join Date: Nov 2001
Status: Offline
Reply With Quote
Mar 1, 2003, 01:54 PM
 
Thanks guys that helped a lot!
     
Forum Regular
Join Date: Dec 2002
Location: Twin Cities
Status: Offline
Reply With Quote
Mar 4, 2003, 02:47 PM
 
Originally posted by Millennium:
The advice Optimus gave will work, but there's a better way to do it. Instead of using:
Code:
.speciallink a:link
use:
Code:
a.speciallink:link
Then, you put the class attribute directly on the A tags, rather than wrapping them in a P tag. That'll cut down on page size a bit.
Code:
<.a href="blah" class="speciallink">
(remove the dot at the beginning of the tag, of course.)

That shows up only in Safari v62, and is a bug in that browser. Hyatt has noted that it has already been fixed for the next public release. So I wouldn't worry about it for now.

I've been using the classes on "a" tags seemingly forever. You used to have to use them for link colors to show up properly in NE4.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:50 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2