Forum Moderators: open

Message Too Old, No Replies

intermittent issue in ie7 displaying css styles links

arghhh

         

sneaks

8:13 pm on Jan 21, 2007 (gmt 0)

10+ Year Member



i have a styled link that ie7 is not displaying properly. it randomly ignores all the css however if i replace the href with a '#' instead of the file location reference, then it displays properly. very weird.

when i preview it localhost i only see the link text and all the subsequent links are floated left instead of below. there is no width and height etc... but when i look online (link below) some show proper and some dont.

the html:


<a class="linkChalets" href="#./index.php?item=chalets&amp;id=zermatt"
onmouseover="swapImage('chalets','./images/chalet_zermatt.jpg');">Le Zermatt</a>
<a class="linkChalets" href="./index.php?item=chalets&amp;id=lausanne"
onmouseover="swapImage('chalets','./images/chalet_lausanne.jpg');">Le Lausanne</a>
<a class="linkChalets" href="./index.php?item=chalets&amp;id=neuchatel"
onmouseover="swapImage('chalets','./images/chalet_.jpg');">Le Neuchatel</a>
<a class="linkChalets" href="./index.php?item=chalets&amp;id=alps"
onmouseover="swapImage('chalets','./images/chalet_alps.jpg');">Les Alps</a>
<a class="linkChalets" href="./index.php?item=chalets&amp;id=montreux"
onmouseover="swapImage('chalets','./images/chalet_montreux.jpg');">Le Montreaux</a>
<a class="linkChalets" href="./index.php?item=chalets&amp;id=zurich"
onmouseover="swapImage('chalets','./images/chalet_zurich.jpg');">Le Zurich</a>
<a class="linkChalets" href="./index.php?item=chalets&amp;id=geneve"
onmouseover="swapImage('chalets','./images/chalet_geneve.jpg');">Le Geneve</a>
<a class="linkChalets" href="./index.php?item=chalets&amp;id=davos"
onmouseover="swapImage('chalets','./images/chalet_davos.jpg');">Le Davos</a>

the css:


a.linkChalets:link {
display: block;
width:304px;
height:46px;
margin: 0px 0px 10px 0px;
padding: 5px 0px 00px 0px;
background-image:url(../nav/chalets_link_0.gif);
text-decoration: none;
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 12px; color:#5e5753;
text-align: center;
}

thanks
jd

[edited by: encyclo at 8:20 pm (utc) on Jan. 21, 2007]
[edit reason] no links to personal sites please, see forum charter [/edit]

penders

8:48 pm on Jan 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



...it randomly ignores all the css...

I don't think it's random...

The :link pseudo class is for styling unvisited links only. (ie. links for pages not already in the browsers cache.) Conversely, the :visited pseudo class styles all the visited links.

Check out the W3C...
[w3.org...]

So, you need to define a style for both a.linkChalets:link and a.linkChalets:visited classes in order to cover both cases, or simply do it all in one go by styling 'a.linkChalets' directly (if you want both unvisited and visited links to look the same).

NB: the browsers default styles for :link and :visited anchors are different.

sneaks

9:07 pm on Jan 21, 2007 (gmt 0)

10+ Year Member



now thats what i'm talking about...

thx and i will make sure to not post a link again...

:)