View Full Version : CSS Problem, help !!!!~~~~
joelnet
04-28-2006, 07:31 AM
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
brightmosquito
04-28-2006, 07:57 AM
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>
[b]
<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?
brightmosquito
05-09-2006, 05:08 AM
got it, thanx
edified
11-26-2006, 12:15 PM
Alternatively you could change the default display type for the anchor.
[quote]
display:block;
</CODE>
(the default is display:inline) That would save you from using unnecessary divs in your markup.
Cheers
Ed Palma (http://edified.org/resume) - edified.org (http://edified.org/)
vBulletin® ©Jelsoft Enterprises Ltd.