![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Help...help help. How do I have the whole design centered on the page - relative to how wide the user has the window stretched (as in no docked). I have tried many things and still cannot figure this out - and I'm sure it's fairly simple?? Yes? No? Desperately seeking centering * ![]() |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Help...help help. How do I have the whole design centered on the page - relative to how wide the user has the window stretched (as in no docked). I have tried many things and still cannot figure this out - and I'm sure it's fairly simple?? Yes? No? Desperately seeking centering * ![]() |
#5
| |||
| |||
|
|
well, I just tested this on mac and it works: div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: red;"><div style="position: absolute; top: 25%; height: 50%; left: 10%; border: 1px solid #fff; width: 80%; background: blue; margin-left: -20px; margin-top: -20px; padding: 20px; ">content</div></div ![]() singindesigner wrote: Help...help help. How do I have the whole design centered on the page - relative to how wide the user has the window stretched (as in no docked). I have tried many things and still cannot figure this out - and I'm sure it's fairly simple?? Yes? No? Desperately seeking centering * ![]() |
#6
| |||
| |||
|
|
I wouldn't do it that way at all, Misha. Nested absolutely positioned inline divs can be problematic. Try this - style type="text/css" !-- body { text-align:center } /* for IE5+ */ #wrapper { width:760px; margin:0 auto; position:relative; test-align:left;} -- /style ... body div id="wrapper" the rest of the page content goes here /div><!-- /wrapper -- /body |
#7
| |||
| |||
|
|
well, I just tested this on mac and it works: div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: red;"><div style="position: absolute; top: 25%; height: 50%; left: 10%; border: 1px solid #fff; width: 80%; background: blue; margin-left: -20px; margin-top: -20px; padding: 20px; ">content</div></div ![]() singindesigner wrote: Help...help help. How do I have the whole design centered on the page - relative to how wide the user has the window stretched (as in no docked). I have tried many things and still cannot figure this out - and I'm sure it's fairly simple?? Yes? No? Desperately seeking centering * ![]() |
#8
| |||
| |||
|
|
so just: div style="position: absolute; top: 25%; height: 50%; left: 10%; border: 1px solid #fff; width: 80%; background: blue; margin-left: -20px; margin-top: -20px; padding: 20px;">content</div works fine I think. Misha wrote: well, I just tested this on mac and it works: div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: red;"><div style="position: absolute; top: 25%; height: 50%; left: 10%; border: 1px solid #fff; width: 80%; background: blue; margin-left: -20px; margin-top: -20px; padding: 20px; ">content</div></div ![]() singindesigner wrote: Help...help help. How do I have the whole design centered on the page - relative to how wide the user has the window stretched (as in no docked). I have tried many things and still cannot figure this out - and I'm sure it's fairly simple?? Yes? No? Desperately seeking centering * ![]() |
#9
| |||
| |||
|
|
Nope. Negative margins can be trouble, and percent width/height with positioning is also problematic. |
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |