|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
css linkstyle rendering problem in safari
I have produced some linkstyles in dreamweaver mx using css properties of a:link, a:hover etc.
I want my links to have a background box which changes colour when the link is rolled over. The code I have produced (see below) works perfectly in IE 5.2 on the mac but in safari the box height and width parameters are seemingly ignored so any background colour/border properties only affect the area directly behind the text and are not applied to the box as they should be. Anyone know how to get this working in safari? thanks bob <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- a:link { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #003366; text-align: left; height: 20px; width: 200px; border-top-width: 1px; border-top-style: solid; border-top-color: #FFFFFF; text-decoration: none; margin: 0px; text-indent: 15px; vertical-align: middle; line-height: 20px; background-color: #EAEEEE; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #CCCCCC; } a:visited { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #003366; text-align: left; height: 20px; width: 200px; border-top-width: 1px; border-top-style: solid; border-top-color: #FFFFFF; text-decoration: none; margin: 0px; text-indent: 15px; vertical-align: middle; line-height: 20px; background-color: #EAEEEE; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #CCCCCC; } a:hover { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #003366; text-align: left; height: 20px; width: 200px; border-top-width: 1px; border-top-style: solid; border-top-color: #FFFFFF; text-decoration: none; margin: 0px; text-indent: 15px; vertical-align: middle; line-height: 20px; background-color: #B8D6FF; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #CCCCCC; } --> </style> </head> <body leftmargin="0" topmargin="0"> <p><a href="link1">link to me now</a><br> <a href="link2">ok i'm a link</a><br> <a href="link3">you guessed it</a><br> <a href="link4">someone say link</a><br> </p> </body> </html> |
|
#2
|
||||
|
||||
|
safari does the right thing,
width and height assigned to an inline element should be ignored. use display:block; to make the anchor elements to act like blocklevel elements. a:link { display:block; note instead of border-top-width: 1px; border-top-style: solid; border-top-color: #FFFFFF; you could write border-top:1px solid #ffffff; |
|
#3
|
|||
|
|||
|
Hi Akh
Thanks for that. I've never come across inline and block level elements. Can you tell me where I can find out about them. I added the a:link { display:block; as you suggested. Safari now sees the box. success! BUT... a space has now appeared between each link that wasn't there before. There should be no spaces between my link boxes and I don't know whats causing it Any ideas? thanks again spirit |
|
#4
|
||||
|
||||
|
remove the <br> tags
![]() w3.org is all the source you need http://www.w3.org/TR/html4/struct/global.html#h-7.5.3 http://www.w3.org/TR/CSS2/visuren.html http://www.w3.org/TR/CSS2/visudet.html Last edited by Akh : December 4th, 2003 at 09:02 PM. |
|
#5
|
|||
|
|||
|
Thnks Akh
you've made my day! bob |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > css linkstyle rendering problem in safari |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|