Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    CSS doesn´t load properly in Chrome

    I use the following code to create a link in a meny:

    <
    Code:
    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:

    Code:
    .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?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,862
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    <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 and there by your markup has many errors in it. Validate your markup and fix the errors. For instance, the above code should be something like
    Code:
    .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;
    }
    Code:
    <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!
    Last edited by abduraooft; 01-09-2010 at 04:07 PM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    mumbojumbo (01-09-2010)

  • #3
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •