Web Wiz - Solar Powered Eco Web Hosting

  New Posts New Posts RSS Feed - <DIV> Quession...
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic Closed<DIV> Quession...

 Post Reply Post Reply
Author
Necronom View Drop Down
Groupie
Groupie


Joined: 19 October 2001
Location: United States
Status: Offline
Points: 116
Direct Link To This Post Topic: <DIV> Quession...
    Posted: 10 June 2004 at 9:10pm

When working with <div> tags and z-index positioning, the page itself makes room for the positioned layer wherever it's supposed to be. So, if you're using a lot of absolute positioned layers, you'll wind up with a ton of empty space at the bottom of the page. Does anyone know a way around this?

(sorry if this sounds a little confusing)

TIA!

. necronom .

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3938
Direct Link To This Post Posted: 11 June 2004 at 12:13am

The div is a block element and all block elements have a built in padding and margins which varies by browser but can be overidden with css and even set to negative values.

Top and Bottom values for padding are cumulative. Top and Bottom values for margins are not.
In this example, them amount of space between the two div's is 10 ems as padding is cumulative

<div style="padding: 5em;">Div One</div>
<div style="padding: 5em;">Div Two</div>

In this example, the amount os space between the divs is 5 em as the top amd bottom margins overlap
<div style="margin: 5em;">Div One</div>
<div style="margin: 5em;">Div Two</div>

When specifying margins or padding (e.g. padding: 0 0 0 0; -

  1. If 1 value is used, all borders use it
  2. If 2 values are used, the first is the Top+Bottom, the second is Left+Right
  3. If 3 vaules are used, the first is the Top, the second Left+Right, and the third the bottom.
  4. If 4 values are used, they correspond to TRBL.

In your case, using absolute positioning, you may want to set the padding to 0 and just use the margins for positioning - e.g.

<div style="padding: 0; margin: T R B L">The Content</div>


Lead me not into temptation... I know the short cut, follow me.
Back to Top
Necronom View Drop Down
Groupie
Groupie


Joined: 19 October 2001
Location: United States
Status: Offline
Points: 116
Direct Link To This Post Posted: 11 June 2004 at 10:23am
interesting. I will try it out.

Thank you!

btw, do you run a website at all? Because you've helped me out on a lot of stuff around here over time. =)

. necronom .
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3938
Direct Link To This Post Posted: 11 June 2004 at 11:18am
I have a personal site, but it's more of a gateway for web mail than anything else. Mostly build sites for others.

Lead me not into temptation... I know the short cut, follow me.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.07
Copyright ©2001-2024 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2024 Web Wiz Ltd. All rights reserved.