Jump to content

Recommended Posts

Posted

I don't if anyone here can help but found some code on net to use CSS to produce a CMS type link which I quite liked but it renders differently in Firefox from IE - can anyone help me display it left aligned in both browsers?







Click on the links below for our opening dates


<br />
<!--<br />
a:visited {<br />
  text-decoration:none; <br />
  text-align:left;<br />
  background-color:#FFDE08; <br />
  color:#000000; <br />
  display:block; <br />
  width:50%; <br />
  border:2px solid #fff;<br />
  border-color:#def #678 #345 #cde;<br />
  padding:0.25em;<br />
  margin:0.5em auto;<br />
  }<br />
a:link {<br />
  text-decoration:none; <br />
  text-align:left;<br />
  background-color:#FFDE08; <br />
  color:#000000; <br />
  display:block; <br />
  width:50%; <br />
  border:2px solid #fff;<br />
  border-color:#def #678 #345 #cde;<br />
  padding:0.25em;<br />
  margin:0.5em auto;<br />
  }<br />
<br />
a:hover {<br />
  top:2px;<br />
  left:2px;<br />
  color:#000000;<br />
  border-color:#345 #cde #def #678;<br />
  }<br />
//--><br />









[b]Click on the links below for our opening dates[/b]




[b]This 
school year (Sep 2006- Jul 2007)[/b]


[b]Next 
school year (Sep 2007 - Jul 2008)[/b]




 

regards

Simon

PS or point me off to the equivalent of here for web coding :)

Posted
It's the margin:0.5em auto; on a:visited and a:link that is aligning it in the middle (the auto is being applied to the left and right margins and 0.5em to the top and bottom). Just remove the 'auto' bit.
Posted

@craig

Ta very much :D

 

Do you know why the browsers treat it so differently (and which one is doing it "right" (or is it neither!) ) :)

 

regards

 

Simon

Posted
I agree with everything Geoff says. There are also "workarounds" or "hacks" that you can do in CSS to aim certain attributes to certain browsers. For example you can enclose a style directive by comments that one browser will ignore and another won't.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...