Click to See Complete Forum and Search --> : Link Width Problem


Bluetagpizza
03-15-2005, 10:58 PM
I am having trouble setting the width & height of a link with CSS in XHTML. The CSS: ul.menu a {width:100px; height:20px;} works fine until I add the doctype to the document. Then the width & height are totally disregarded by IE, Firefox, and Opera. Does anyone know why that might be? I didn't define a width or height anywhere else in the CSS or HTML.

Edit: The CSS and HTML validate (After I put in the doctype)

ray326
03-16-2005, 12:10 AM
An anchor is inline, which doesn't have dimensions like that.

felgall
03-16-2005, 02:14 PM
Try adding display:block to make the anchor tag a block tag instead of an inline tag in this situation.