Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 716 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     HTML/XHTML/DHTML/CSS :

[CSS] What kind of syntax do you use?

Thread title: [CSS] What kind of syntax do you use?
Closed Thread  
Page 1 of 4 1 2 3 4 >
    Thread tools Search this thread Display Modes  
10-31-2007, 12:16 AM
#1
Andrew R is offline Andrew R
Status: Request a custom title
Join date: Dec 2005
Location: Arizona
Expertise:
Software:
 
Posts: 5,200
iTrader: 17 / 95%
 

Andrew R is on a distinguished road

  Old  [CSS] What kind of syntax do you use?

In the ChatWebDev IRC channel yesterday, we were talking about our different CSS syntaxes. I'm just curious what you all use.

I'm fond of the following:
Code:
.class {
	selector: value;
}
Though, also this can work for me (not what I use):
Code:
.class {
selector: value;
}
Code:
.class
{
	selector: value;
}
or any variation between those too.

What kinds do you like? I can't stand ones that make it nearly impossible to read, and very unorganized, like this one I've seen:
Code:
.class {
selector: value;}
.class {
selector: value;}

10-31-2007, 12:26 AM
#2
Amross is offline Amross
Status: Member
Join date: Jan 2007
Location:
Expertise:
Software:
 
Posts: 311
iTrader: 4 / 100%
 

Amross is on a distinguished road

  Old

I use the first one aka the one you are fond of.

10-31-2007, 12:27 AM
#3
Anthony is offline Anthony
Status: Sin Binner
Join date: Jul 2004
Location: Yorkshire Coast - UK
Expertise:
Software:
 
Posts: 5,911
iTrader: 29 / 91%
 

Anthony is on a distinguished road

Send a message via MSN to Anthony

  Old

Code:
.class {
selector: value;
}

10-31-2007, 12:41 AM
#4
daz is offline daz
Status: I love this place
Join date: Jun 2005
Location: UK
Expertise:
Software:
 
Posts: 562
iTrader: 5 / 100%
 

daz is on a distinguished road

Send a message via MSN to daz

  Old

Code:
.class {
	selector: value;
}

10-31-2007, 01:07 AM
#5
Lee_ is offline Lee_
Status: Member
Join date: Jun 2006
Location: UK
Expertise:
Software:
 
Posts: 184
iTrader: 2 / 100%
 

Lee_ is on a distinguished road

  Old

HTML Code:
.class
{
	selector: value;
}
FTW.

10-31-2007, 01:11 AM
#6
alefort is offline alefort
alefort's Avatar
Status: Junior Member
Join date: Oct 2007
Location: Canada
Expertise:
Software:
 
Posts: 50
iTrader: 0 / 0%
 

alefort is on a distinguished road

Send a message via MSN to alefort

  Old

I use #1 when it involves only one or two lines, I use #3 when its a large chunk of CSS. I use the same formatting rules when I code.

10-31-2007, 01:24 AM
#7
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

I use CSS, it's all the same syntax! As for laying out the styles, I'd have to say "none of the above".

10-31-2007, 01:36 AM
#8
unr is offline unr
Status: Member
Join date: Oct 2007
Location: Ontario
Expertise:
Software:
 
Posts: 371
iTrader: 4 / 100%
 

unr is on a distinguished road

Send a message via MSN to unr

  Old

#3, Always and forever.

10-31-2007, 01:38 AM
#9
Gurnk is offline Gurnk
Status: Member
Join date: May 2007
Location: US
Expertise:
Software:
 
Posts: 380
iTrader: 12 / 100%
 

Gurnk is on a distinguished road

Send a message via AIM to Gurnk Send a message via MSN to Gurnk

  Old

Code:
.class {
	selector:value;
}
No Space . But basically the same thing.

10-31-2007, 02:53 AM
#10
Lance... is offline Lance...
Lance...'s Avatar
Status: Member
Join date: Jun 2007
Location: East Yorkshire, England
Expertise:
Software:
 
Posts: 112
iTrader: 1 / 100%
 

Lance... is on a distinguished road

Send a message via MSN to Lance...

  Old

Code:
.class {
	attribute: value;
        attribute: value;
        attribute: value; }
Recently I've started putting the closing bracket at the end of the last attribute, just to save that extra line. They mount up in a big script!

I also group certain attributes which are similar such as:

Code:
.class {
	height: value; width: value;
        padding: value; margin: value; }
Just seems natural to have those on the same line

Peace, Lance

Closed Thread  
Page 1 of 4 1 2 3 4 >


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed