By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,846 Members | 1,836 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,846 IT Pros & Developers. It's quick & easy.

Use of trailing semicolons in stylesheets

P: n/a
Hi folks,

What's the general concensus on including the final semicolon in a group of
style declarations? I know that, as a separator rather than a terminator,
it's redundant and, as a veteran Pascal programmer, tend not to use them
myself. However, I see recommendations that they should be used, for reasons
such as "it's easier to cut and paste" and "some user-agents expect it".

Any comments?

Cheers,
Rowan
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Rowan Malin <ro**********@hotmail.com> wrote:
What's the general concensus on including the final semicolon in a
group of style declarations?


Obviously I alone can't tell you the general consensus, but it's my opinion
that to use this last semicolon is good practice because (1) I can add on to
the code without making sure to put in that extra character and (2) for my
personal sanity having each line end with a semicolon looks nicer. I've
noticed in almost every site that offers css code the final semicolon is
used.
--
Michael Wilcox
mjwilco at yahoo dot com
Essential Tools for the Web Developer - http://mikewilcox.t35.com
Jul 20 '05 #2

P: n/a

"Rowan Malin" <ro**********@hotmail.com> wrote in message
news:bt************@ID-177236.news.uni-berlin.de...
Hi folks,

What's the general concensus on including the final semicolon in a group of style declarations? I know that, as a separator rather than a terminator,
it's redundant and, as a veteran Pascal programmer, tend not to use them
myself. However, I see recommendations that they should be used, for reasons such as "it's easier to cut and paste" and "some user-agents expect it".

Any comments?

Cheers,
Rowan

I've never heard of a UA expecting it. I do it simply because sure as rain,
when I add another property to the selector, I'll forget to add the
semicolon and I'll tear my hear out for a few minutes at least wondering
what the hell I did.

So I do it for cosmetic reasons. ;)
Jul 20 '05 #3

P: n/a
On Sat, 03 Jan 2004 05:13:07 GMT, "Michael Wilcox"
<mj*****************@yahoo.com> wrote:
Rowan Malin <ro**********@hotmail.com> wrote:
What's the general concensus on including the final semicolon in a
group of style declarations?
Obviously I alone can't tell you the general consensus, but it's my opinion
that to use this last semicolon is good practice because (1) I can add on to
the code without making sure to put in that extra character and (2) for my
personal sanity having each line end with a semicolon looks nicer.


<AOL mode>

Me too.

</AOL mode>

To answer the OP's other point: I've not heard of a browser which has
problems with either the presence or absence of the trailing semicolon.
(Nearest I can think of is one or two which hiccup if the white-space
isn't to their liking.)

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #4

P: n/a
On Sat, 3 Jan 2004 01:19:59 -0500, "Neal" <ne**@spamrcn.com> wrote:

"Rowan Malin" <ro**********@hotmail.com> wrote in message
news:bt************@ID-177236.news.uni-berlin.de...
Hi folks,

What's the general concensus on including the final semicolon in a group

of
style declarations? I know that, as a separator rather than a terminator,
it's redundant and, as a veteran Pascal programmer, tend not to use them
myself. However, I see recommendations that they should be used, for

reasons
such as "it's easier to cut and paste" and "some user-agents expect it".

Any comments?

Cheers,
Rowan

I've never heard of a UA expecting it. I do it simply because sure as rain,
when I add another property to the selector, I'll forget to add the
semicolon and I'll tear my hear out for a few minutes at least wondering
what the hell I did.

So I do it for cosmetic reasons. ;)


Someone else who does it religiously (i.e. without fail) is Eric Meyer.
Since he consults on CSS and has written three books on the subject, I think
it's fair to say he's a CSS expert.

Like the OP, I've done a lot of Pascal programming and I tend to omit
that final semicolon. But now, every time I do, a little voice in the back of
my head asks, "What would Eric type?" <g>
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.