width and height styles on tag

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I just encountered a strange thing when switching the doctype
on and off in the following html testpage (with IE 6.0):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ">
  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  <style type="text/css">
   p {
    width: 50%;
    background-color: #dddddd
   a {
    height: 200px;
    width: 500px;
    background-color: #cccccc
   a:hover {
    background-color: #cccc00

  <a href="#">Testlink</a>

With doctype xhtml-strict turned on, the height / width on the <a> tag is

My question is: Is this the desired behaviour? Does xhtml-strict not allow
reformatting of the <a> tags with regard to width / height?

My problem is, that I would rather like to switch background color in a
area than only behind the text when hovering over the link. I could easily
embed the <a> tag in a paragraph <p> of appropriate size, but then color
switching while hovering is only performed on the small <a> tag.

Any help is appreciated.



Clemens Quo▀

Site Timeline