473,405 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Use of trailing semicolons in stylesheets

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
4 2883
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

"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mage | last post by:
Hello, I amafraid of I will stop using semicolons in other languages after one or two months of python. However I see that python simply ignores the semicolons atd the end of the lines. ...
5
by: George B | last post by:
Is it possible to use headers (H1, H2, H3 etc) but without a blank line being inserted after them ? For example, at the moment the html I have written gives me.... THIS IS THE HEADER This...
2
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/newsgroup-faq Posting-Frequency: once a week Last-modified: 2004-07-26 Version: 2.00 URL: <http://css.nu/faq/ciwas-mFAQ.html> Maintainer: Jan Roland Eriksson...
0
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/newsgroup-faq Posting-Frequency: once a week Last-modified: 2004-07-26 Version: 2.00 URL: <http://css.nu/faq/ciwas-mFAQ.html> Maintainer: Jan Roland Eriksson...
0
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/newsgroup-faq Posting-Frequency: once a week Last-modified: 2004-07-26 Version: 2.00 URL: <http://css.nu/faq/ciwas-mFAQ.html> Maintainer: Jan Roland Eriksson...
4
by: Prowler | last post by:
In the application we are currently building, we need to write positioning code on-the-fly, based upon the screen offset of the element in the AS/400 application which drives the Web app. The 400,...
27
by: Jeremy Yallop | last post by:
Write a program that takes a C program in source form as input and prints the source code for a program with equivalent behaviour, but without semicolons, on standard output. Please note that...
5
by: brian.j.parker | last post by:
Hey all, I've noticed an obscure little quirk: it appears that if you use a login with trailing spaces on the name, SYSTEM_USER automatically trims those trailing spaces in SQL Server 2000, but not...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.