CSS Problem, help !!!!~~~~

Discussion in 'HTML / PHP / JavaScript / CSS' started by joelnet, Apr 28, 2006.

  1. Doc types do change the way the html and css is rendered. I'd recommend putting a surrounding container like a div or a span and set the width on that. it's uncommon to set the width of the anchor.


    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
  2. This is my page


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <style type="text/css">
    a.text: link, a.text: visited
    {
    width: 150px; background-color: #CCCCCC;
    }
    a.text: hover
    {
    width: 150px; background-color: #CCCCCC;
    }
    </style>
    </head>

    <a href="#" class="text">Test Link</a>
    </body>
    </html>


    Problem is, the "width" does not work. But if I take out "<DOCTYPE...>", it will work. Is there anything wrong with my CSS code?
     
  3. got it, thanx
     
  4. Alternatively you could change the default display type for the anchor.
     

Share This Page