|
This was originally posted on my old blog. From the search traffic on the post it seems like a lot of people are running into this problem and I figured I would repost it here.
It appears that the HTML standard has changed while none of us were watching. Because of this VS2005 like to throw a lot of cool warnings such as this:
Validation (XHTML 1.0 Translation): Attribute 'height' is considered outdated. A newer construct is recommended. Very helpful don't you think? So what kind of construct fixes this warning? You have to apply a style in one of two ways. You can either use a class specification from a style sheet file or an inline style. To me, while I find it annoying to have to type more than I did with the attribute, the inline style seems to work better. This is especially true if you want to set the attribute on just one tag.
So what does this look like? Here is an example of the before and after for setting the height of a cell. From my experience you can use padding or line-height, but line-height seems to most equivalent result.
Becomes ...
<td style="line-height:40px;"> Of course you cannot have height without width. Luckily the width attribute has an corresponding style of the same name.
I hope this helps those of you who are struggling with this message. Please feel free to leave comments or email me if this helped or not.
|