Sent by Bob Easton on 2 November 2004 11:11
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?
>>
>>
> That is odd. In any case, inline Javascript like that should be a last
> 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.
Samll clarification: That's not inline Javascript. It's inline CSS. It
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.
http://css-discuss.incutio.com/?page=GoodBooks
--
Bob Easton
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/