CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 4th, 2003, 08:05 PM
iambob iambob is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 10 iambob User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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>
Attached Files
File Type: html linktest.html (1.7 KB, 94 views)

Reply With Quote
  #2  
Old December 4th, 2003, 08:18 PM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 2,622 Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 6 Days 2 h 18 m 25 sec
Reputation Power: 548
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;

Reply With Quote
  #3  
Old December 4th, 2003, 08:28 PM
iambob iambob is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 10 iambob User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old December 4th, 2003, 08:56 PM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 2,622 Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 6 Days 2 h 18 m 25 sec
Reputation Power: 548

Last edited by Akh : December 4th, 2003 at 09:02 PM.

Reply With Quote
  #5  
Old December 4th, 2003, 09:05 PM
iambob iambob is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 10 iambob User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile

Thnks Akh

you've made my day!

bob

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > css linkstyle rendering problem in safari


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway