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
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
spam issues
by ECNet - 03/19/2024 11:45 PM
Who's Online Now
0 members (), 686 guests, and 131 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)