Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Do you give your <body> an ID? Two pics
Old 11-16-2007, 04:40 PM Do you give your <body> an ID? Two pics
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
I got this in an email

http://css-tricks.com/examples/CleanCode/CleanCode.jpg

And I'm a little confused on the ID in the body tag. There's only 1. It seems like navigation menus or paragraphs or any kind of thing that there's a lot of repetition but different content inside, should get a ID. But the body tag is pretty easy to distinguish because there's only 1.

I get the point about you can make all kinds of page specific changes outside that page you want to change. But is that really the best level to go changing things at? Think how much that'll grow your CSS file for a large site!
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-16-2007, 04:59 PM Re: Do you give your <body> an ID? Two pics
King Spam Talker

Posts: 1,186
Location: Manchester, UK
Trades: 0
I thought one of the advantages of using CSS was to give a consistent look to all your <h2>s etc. with just one rule. If you want to distinguish some <h2>s from others, shouldn't we be using classes for them instead of uniquifying the <body>?
gringo is offline
Reply With Quote
View Public Profile Visit gringo's homepage!
 
Old 11-16-2007, 06:01 PM Re: Do you give your <body> an ID? Two pics
Average Talker

Posts: 23
Trades: 0
i suggest you not to put id on the body tag... cause the body tag has no other instance of other body or there is only one body tag on every webpage.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
mountlaurel is offline
Reply With Quote
View Public Profile Visit mountlaurel's homepage!
 
Old 11-16-2007, 06:06 PM Re: Do you give your <body> an ID? Two pics
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Actually, using an ID on the body tag can have some advantages, though I wouldn't put an id on the body of EVERY page. I only do it on sites where, say, the home page is a slightly different layout than the rest of the site, or some other page, for whatever reason, may be different.

You can still control the whole site with one file.. the CSS file, you just may have to pay attention to a few more ID's.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 11-16-2007, 07:15 PM Re: Do you give your <body> an ID? Two pics
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 9,007
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
It seems to make sense, though. By doing it that way you can still override style rules for elements on individual elements, with no-inherits where necessary to avoid the cascade. Done right, it's a good way to organize your style rules.
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Old 11-17-2007, 06:42 AM Re: Do you give your <body> an ID? Two pics
Foundationflash's Avatar
Ultra Talker

Posts: 410
Name: Harry Burt
Location: Colchester, Essex, England
Trades: 0
When I was building my site, I looked at Dan Cederholm's SimpleBits.com site, and because that uses a different homepage layout, that has an ID for the body tag on the front page.
__________________
Foundation Flash tutorials :
Please login or register to view this content. Registration is FREE


New Dreamed Up Web Design:
Please login or register to view this content. Registration is FREE
Foundationflash is offline
Reply With Quote
View Public Profile Visit Foundationflash's homepage!
 
Old 11-17-2007, 10:35 AM Re: Do you give your <body> an ID? Two pics
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
I think I can answer this question with a practical example, although I don't use it very often.

http://www.canterburyclinic.ca/

I used an id tag on the subpages (not the home page) and a faux background for the center part. I also created small CSS files for each color so that I could apply specific colors to other properties for each page.

(And yes, I know the news needs to be updated, and already told the client. This site isn't fully launched yet.)
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 11-17-2007, 07:31 PM Re: Do you give your <body> an ID? Two pics
Defies a Status

Posts: 3,420
Trades: 0
I've never done this before myself, but I've seen it recommended. The primary reason I saw was for highlighting the current page in the navigation bar. I've actually found a PHP way around this, and since I use PHP to put the page together (header.php, footer.php etc.), then I couldn't uniquely assign the body tag a different id on each page (unless I used more PHP).

It certainly has it's uses, but unless there is a specific reason for doing so, I wouldn't bother.

By the way, you found that through StumbleUpon right? I saw it yesterday or the day before
CSS4Life is offline
Reply With Quote
View Public Profile
 
Old 11-19-2007, 08:25 PM Re: Do you give your <body> an ID? Two pics
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
Where's the second pic...?

I've been using jscript lately to put coolness int my pages, and haven't needed to give the body tag an ID. I usually give the page body some styling rules at the body level, but this is usually stuff I want to be consistent across all pages. I guess this makes sense though, if you have 'sections' on a site that should look different.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 11-19-2007, 11:40 PM Re: Do you give your <body> an ID? Two pics
Novice Talker

Posts: 5
Name: Leo
Trades: 0
I would only use the body id tag if the layout was different throughout the page
bigleo23 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Do you give your <body> an ID? Two pics
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.49202 seconds with 12 queries