...

View Full Version : CSS doesn´t load properly in Chrome



mumbojumbo
01-09-2010, 02:09 PM
I use the following code to create a link in a meny:

<
td width="60" bgColor=#000000 class="lank2" align="center" onclick="window.location.href='index.html'" onMouseOver="this.bgColor='#666666'" onMouseOut="this.bgColor='#000000'">START</td>

As you can see I create the link in a <td>, background color black wich turns grey onMouseOver.
With a black backgroun color I need to make the text white. This I do using the follow css:


.lank2 {
font-family: "Myriad Web", Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
font-style: normal;
font-weight: bold;
text-decoration: none;
color: #FFFFFF;
cursor: default;
}

The CSS-code loads properly in ie but in Crome it doen't load wich means that the text remains black. With my black background thios means that the text is invisible. However if I reload the page in Crome the CSS is added and the text is white wich I want.
Anyone know why this happens?

abduraooft
01-09-2010, 02:21 PM
<td width="60" bgColor=#000000 class="lank2" align="center" onclick="window.location.href='index.html'" onMouseOver="this.bgColor='#666666'" onMouseOut="this.bgColor='#000000'">START</td>You are using a lot of deprecated attributes (http://www.codehelp.co.uk/html/deprecated.html) and there by your markup has many errors in it. Validate your markup (http://validator.w3.org) and fix the errors. For instance, the above code should be something like

.lank2 {
font-family: "Myriad Web", Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
font-style: normal;
font-weight: bold;
text-decoration: none;
color: #FFFFFF;
cursor: default;
width:60px;
background-color:#000000;
text-align:center;
}

<td class="lank2" onclick="window.location.href='index.html'"
onMouseOver="this.backgroundColor='#666666'" onMouseOut="this.backgroundColor='#000000'">START</td>

And there's one more important point => using tables for layout is stupid (http://www.hotdesign.com/seybold/)!

mumbojumbo
01-09-2010, 04:02 PM
Great thanks, abduraooft!
(Sorry that i´ve just used a <b>-tag, bu I felt that I needed to :-)

Your help was realy useful. I also apreciated the links.
I WILL get rid of my tables asap!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum