Christian Heilmann wrote:
>> Is it wrong to write style this way.
>> <div style="left:10px;" > </div>
>> w3c HTML validator seems to have no problem with a ; before " and you
>> what do you think?
> resort. By using CSS inline, you strip it from its biggest power:
> Allowing all visual presentation to be maintained in one place rather
> than each document.
is perfectly legal and frequently used, but as Chris points out does not
separate presentation from content as well as it could.
The original question was about including, or not including the
semicolon. Either technique is acceptable. The semicolon is required to
separate attributes, but is not required at the end of a list of
attributes or when there is only one attribute. My preference is to
always include it because I often go back and add more attributes. I
find that always including the semicolon leads to fewer syntax errors.
By the way, a good CSS reference book also answers these questions well
and usually quicker than waiting for list answers.
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/