This is a discussion on "top and left margin around content div" within the Starting Out section. This forum, and the thread "top and left margin around content div are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
top and left margin around content div
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
top and left margin around content div
Hi,
I've got a content div to which I've applied the following css. #content {width:730px; margin:0 auto; background:#F0F0DE url(cedarscafe.gif) no-repeat ;} I am getting a margin at the top of about 10px between the content div and the browser window and also when I pull the width of the screen in I am getting the same margin on the left. How can I prevent this gap? Any help greatly appreciated. Paul Rich |
|
|
|
|||
|
Re: top and left margin around content div
Try:
It can cause some problems but may solve your problem. Pete. |
|
|||
|
Re: top and left margin around content div
Spot on pa007, you are a gentleman and a scholar. Do you know what the logic is behind that? as I didn't think that divs had default margins.
|
|
|||
|
Re: top and left margin around content div
Different browser set different default margins on all different elements. It could have been a margin on something like the body element or any adjacent element.
Pete. |
![]() |
| Tags |
| margin |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Expandable Content Script (Swtich Content) | Matc | JavaScript Forum | 0 | Apr 8th, 2008 10:53 |
| Content Placement + Content Dividing | josephman1988 | Website Planning | 2 | Jan 22nd, 2008 05:02 |
| Why am I getting a margin when not specified | AdRock | Web Page Design | 4 | Mar 14th, 2007 22:06 |
| margin? | nasumaru | Web Page Design | 14 | Jan 30th, 2007 21:52 |
| Margin top IE | csa | Web Page Design | 5 | Apr 6th, 2006 03:45 |