logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > HTML and CSS
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 11-09-2011, 06:32 PM   #1
gigiloumill
gigiloumill's Avatar
 
Join Date: Apr 2009
Location: Miami, FL
Posts: 493
Default Designing divs

Guys, this might be a silly question but, does a site need to be designed around a main div such as a "wrapper" or can it be designed on the body itself? Thanks
__________________
Keeping your business connected.
www.starionmedia.com
gigiloumill is offline   Reply With Quote
Old 11-09-2011, 07:12 PM   #2
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

No, it doesn't. The body can act as a wrapper too and I prefer to use it like that when needed. You can give it width, height and a margin: 0 auto to center it. If you want to have a background-image or background-color behind the body tag, you can use the html tag for that in your css.
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 11-09-2011, 07:15 PM   #3
johnMoss
johnMoss's Avatar
 
Join Date: Dec 2010
Location: Dallas
Posts: 867
Default

The main purpose of assigning a container inside the body is to allow for the various screen resolutions. You can put a large image in the container, and when the viewer's browser is bigger than that, which is usually the case, the body background fills in the rest.
__________________
LinkedIn: jM
johnMoss is offline   Reply With Quote
Old 11-09-2011, 07:34 PM   #4
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

Quote:
Originally Posted by johnMoss View Post
The main purpose of assigning a container inside the body is to allow for the various screen resolutions.
Kind of... it was more to center content, but why putting an extra div in the mark-up if you can use the body tag for that.

Quote:
You can put a large image in the container, and when the viewer's browser is bigger than that, which is usually the case, the body background fills in the rest.
If you use the body tag as a container then the html background fills the rest
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 11-09-2011, 07:39 PM   #5
johnMoss
johnMoss's Avatar
 
Join Date: Dec 2010
Location: Dallas
Posts: 867
Default

Quote:
Originally Posted by gentleone View Post
why put an extra div in the mark-up if you can use the body tag for that.
Excellent point. One less chunk of code...
__________________
LinkedIn: jM
johnMoss is offline   Reply With Quote
Old 11-09-2011, 07:40 PM   #6
gigiloumill
gigiloumill's Avatar
 
Join Date: Apr 2009
Location: Miami, FL
Posts: 493
Default

Ty. Let me get this straight. If wanted to bypass the body tag, all I would need to do is create a wrapper?
__________________
Keeping your business connected.
www.starionmedia.com
gigiloumill is offline   Reply With Quote
Old 11-09-2011, 08:20 PM   #7
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

Quote:
Originally Posted by gigiloumill View Post
If wanted to bypass the body tag, all I would need to do is create a wrapper?
Come again, G?
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 11-09-2011, 08:28 PM   #8
gigiloumill
gigiloumill's Avatar
 
Join Date: Apr 2009
Location: Miami, FL
Posts: 493
Default

I was just confused. Can you set a width and height on the body tag?5
__________________
Keeping your business connected.
www.starionmedia.com
gigiloumill is offline   Reply With Quote
Old 11-09-2011, 08:50 PM   #9
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

Only use a wrapper div if you think you need one.

There's no point of trying to come up with a reason to use one
domedia is offline   Reply With Quote
Old 11-16-2011, 08:34 AM   #10
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

Quote:
Originally Posted by gigiloumill View Post
I was just confused. Can you set a width and height on the body tag?5
Yes, you can. Personally I do not use heights, but it can. Only 'width' to center things.
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Reply


Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 10:24 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com