Previous Thread
Next Thread
Print Thread
Hop To
#240398 11/30/2010 4:46 PM
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
I'm mucking around with my header block - specifically, a couple of divs in the HTML includes area.

This is a very basic example...
HTML
<div style="padding:10px; margin:0 auto; border:solid 1px #bbb;">

<div style="padding:10px; margin:0px; text-align:center; background:#ffffef;">test header</div>

</div>

The above code nearly fills the whole screen but doesn't quite manage it.

However, when I try this... (adding the width:100%;)
HTML
<div style="padding:10px; margin:0 auto; border:solid 1px #bbb; width:100%;">

<div style="padding:10px; margin:0px; text-align:center; background:#ffffef;">test header</div>

</div>
It forces a horizontal scrollbar.

Can someone point out what I'm doing wrong?

I notice the UBB tag
HTML
<div id="content">
...and I'm wondering if this has any bearing?
However, I can't find a reference to it in the stylesheets.

Help appreciated as always smile

Thanks guys.

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Does your body have a margin to it? It could be the body margin causing it to not fill completely.

Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
No mate, this is a fresh install of my existing data on a test server.

The only code is stock UBB.
HTML
<body onclick="if(event.which!=3){clearMenus(event)}">

Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Ack!
Yes the body must have a default margin.

Just added this to 'Extra Properties'

HTML
body {margin:0;}

...and it's fine.

Thanks for pointing me in the right direction smile


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Slow Queries - Any Ideas?
by BellaOnline - 10/16/2026 4:34 PM
Selling a Forum?
by ECNet - 10/10/2026 10:54 AM
Who's Online Now
7 members (toner, SD, Michael_E6D9, Bill_Owens, BellaOnline, 2 invisible), 374 guests, and 89 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260527)