Hi,

According to CSS 2.1 section 4.1.8, "Declarations and properties"
<http://www.w3.org/TR/CSS21/syndata.html#declaration>  the semicolon is
used to separate multiple declarations for the same selector.

As the last declaration in a declaration block isn't followed by anything
from which it needs to be separated, it doesn't need the semicolon. In the
case of a declaration that is _not_ the last, it would be an error to omit
the semicolon.

Personally, I'd recommend including the semicolon every time. When
somebody goes to modify the stylesheet in the future and adds a
declaration at the end of the block, they may well not notice the lack of
it; as a result, not only would their new declaration not be applied, but
the formerly-last declaration would also suddenly stop working. It's
little things like this that can lead to hours of head-scratching :-(

Regards,

Nick.

On Fri, February 27, 2009 3:29 pm, Ian Piper wrote:
> Hi all,
>
> I am building on a style sheet for a Drupal website. I have noticed
> that in the styles.css file for the theme many of the styles have no
> ";" at the end of the line. This seems mostly to be where there is
> more than one line between the braces, like so:
>
>
> #primarylinks a:hover {
> background:#7d9eac;
> text-decoration:none
> }
>
> I had always thought that the terminating ";" was mandatory. Can
> someone advise me?
>
> Thanks,
>
>
> Ian.
> --
> Ian Piper
> Tellura Information Services - the web, document and information people
> Registered in England and Wales: 5076715, VAT Number: 874 2060 29
> http://www.tellura.co.uk/
> 01926 811574 | 07590 685840
> --
>
>
>
>
>
>
>
> --
> ianpi...@mac.com
> 07590 685840 | 01926 811383
>
>
>
>
>
>
> ______________________________________________________________________
> css-discuss [cs...@lists.css-discuss.org]
> http://www.css-discuss.org/mailman/listinfo/css-d
> List wiki/FAQ -- http://css-discuss.incutio.com/
> List policies -- http://css-discuss.org/policies.html
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
>


-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/


______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to