Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

having issue positioning images in safari

Status
Not open for further replies.

pushyr

Programmer
Jul 2, 2007
159
GB
i have a problem with css background images (i think thats what is causing the issue) that i use in my main navigation. my main navigation or link buttons position incorrectly when viewed in safari, and just a few other browsers. although it seems fine in firefox and internet explorer. but i would like to fix the issue so it works across all the main browers that i've mentioned.

here's the live page
here's what it looks like in safari
here's my div code

Code:
<div id="main_tab_subholder"><div id="main_tab_subcopy"><a href="">tab1</a></div></div>
<div id="main_tab_subspacer"></div>
<div id="main_tab_subholder"><div id="main_tab_subcopy"><a href="">tab2</a></div></div>
<div id="main_tab_subspacer"></div>
<div id="main_tab_subholder"><div id="main_tab_subcopy"><a href="">tab3</a></div></div>
<div id="main_tab_subspacer"></div>
<div id="main_tab_subholder"><div id="main_tab_subcopy"><a href="">tab4</a></div></div>
<div id="main_tab_subspacer"></div>
<div id="main_tab_subholder"><div id="main_tab_subcopy"><a href="">tab5</a></div></div>
<div id="main_tab_subspacer"></div>
<div id="main_tab_subholder"><div id="main_tab_subcopy"><a href="">tab6</a></div></div>
<div id="main_tab_subspacer"></div>


and here is the css code

Code:
#main_tab_subholder a:link, #main_tab_subholder a:visited {
display:block; 
margin:0; 
width:108px; 
height: 22px; 
border: 0px; 
background-image: url(../_images/00_buttons/main_tabs.gif); 
background-repeat: no-repeat; 
position: relative; 
float: left; 
margin-left:0px;
}


#main_tab_subholder a:hover {
background-image: url(../_images/00_buttons/main_tabs_hover.gif);
}
	  
	  
#main_tab_subcopy a:link, #main_tab_subcopy a:visited  {
text-align: center; 
text-decoration: none; 
font-family: Arial, Helvetica, sans-serif; 
color: #ffffff; font-size: 12px; 
font-weight: normal; 
padding-top:0.4em; }


#main_tab_subcopy a:hover {
color: #ffffff;
}	


#main_tab_subspacer {
padding:0.1em; 
float: left; 
margin-left:0px;
}
 
IDs must be unique. Maybe you should switch to using classes instead for your markup. The fact Firefox and IE are showing ok is probably just a coincidence.

Check out all the errors on your page using the validator service: validator.w3.org

PS: It shows fine using Safari 3.04 MacOSX10.4x

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
apologies!! yes, i did resolve the problem. its strange because it wasn't a result of the background images as i'd thought, to fix the issue added float:right; to my css which seemed to sort it out in safari.

to answer your previous question, i am running safari 2.0.4 using a intel macbook.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top