In Visual Studio 2008 the Default.aspx page you get when you create a new web site has the following statement regarding HTML document:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
For exmaple, in order to get the following:
<hr width="800px" align="left" / >
older type html fragment to work, you need to use the following which conforms to CSS 2.0:
<hr style="text-align:'left'; width:'800px'"/>
However, VS2008 produces this error during validation:
Error 1 Validation (CSS 2.0): ''800px'' is not a valid value for the 'width' property.
In CSS 2.0, the width can have the following values, auto | a unit| inherit
However instead of inline styling if you use the style (generated by the IDE) as in::
<style type='text/css'>
hr{
font-family: 'Times New Roman' , Times, serif;
text-align: left;
height: auto;
visibility: visible;
display: inline;
width: 400px;
}
</style>
you will not get this validation error.
Note that in older browsers IE treated hr as an inline element, while the others treated it as a block element.
I have often come across the validation errors in VS 2008. If you do come across them look up this useful reference:
http://gchandra.wordpress.com/2007/10/15/validation-xhtml-10-transitional-a-newer-construct-is-recommended/
also:
http://www.w3schools.com/CSS/CSS_reference.asp
No comments:
Post a Comment