evan
02-19-2008, 06:09 PM
I started laying my page out by positioning Left and top coodinates. This works ok only if I position everything 100px from the left.
I am also using alot of z-indexes -the reason I set it up like this is to have alot of layout flexibilty with my divs and allowing them to be swapped.
My styles look like this:
Is there a way to edit this so that I can center these divs so they reposition themselves for viewers with higher/lower resolutions.
I tried "position: relative;" and "vertical-align:middle;"
<style>
body{
font-family:arial;
background-color: #F6D18D;
}
#bg{
position:absolute;
/*background-image: url(images/bgb.jpg);*/
top:0px;
left:100px;
z-index:2;
width: 800px;
height: 596px;
visibility: visible;
}
#bar{
background-image: url(images/green-nav-bar.jpg);
top:500px;
left:100px;
width: 800px;
height: 20px;
visibility: visible;
position: absolute;
}
b{
text-decoration:none;
color: #FFFFFF;
font-weight: bolder;
}
b:hover{
text-decoration:none;
color: #660000;
font-weight: bolder;
}
a{
text-decoration:none;
color: #FFFFFF;
font-weight: bolder;
}
a:hover{
text-decoration:none;
color: #660000;
font-weight: bolder;
}
#contactus{
position:absolute;
left:537px;
top:574px;
z-index:6;
visibility: visible;
width: 102px;
height: 18px;
}
#bar{
position:absolute;
left:99px;
top:571px;
z-index:5;
width: 801px;
height: 30px;
background-image: url(images/green-nav-bar.jpg);
}
#about{
position:absolute;
left:359px;
top:574px;
z-index:10;
width: 76px;
height: 18px;
visibility: visible;
}
/*account is hidden because it is now in the middle menu not on the bottom */
#account{
position:absolute;
left:638px;
top:575px;
z-index:11;
width: 96px;
height: 20px;
visibility: hidden;
}
#m{
font-size:100%;
position:absolute;
left:160px;
top:274px;
z-index:36;
width: 183px;
height: 21px;
visibility: visible;
}
#n{
font-size:100%;
position:absolute;
left:443px;
top:274px;
z-index:37;
width: 123px;
height: 24px;
visibility: visible;
}
#o{
position:absolute;
left:696px;
top:274px;
color:black;
width: 100px;
height: 24px;
z-index:38;
visibility: visible;
}
#a {
position:absolute;
left:151px;
top: 395px;
color:#000066;
z-index:20;
height: 95px;
width: 171px;
visibility: hidden;
}
#b{
font-size:100%;
position:absolute;
left:352px;
top: 311px;
color:#000066;
z-index:20;
width: 189px;
height: 193px;
visibility: hidden;
}
#c{
font-size:100%;
position:absolute;
left:125px;
top: 123px;
color:#000066;
z-index:30;
width: 735px;
height: 113px;
visibility: hidden;
}
#d{
font-size:100%;
position:absolute;
left:126px;
top: 126px;
color:#000066;
z-index:30;
width: 735px;
height: 70px;
visibility: hidden;
}
#e{
font-size:100%;
position:absolute;
left:127px;
top: 121px;
color:#000066;
z-index:30;
width: 735px;
height: 70px;
visibility: hidden;
}
#f{
font-size:100%;
position:absolute;
left:629px;
top: 309px;
color:#000066;
z-index:35;
width: 189px;
height: 209px;
font-weight: bolder;
visibility: hidden;
}
#one{
font-size:12pt;
position:absolute;
left:128px;
top: 146px;
color:#000000;
z-index:35;
width: 732px;
height: 65px;
font-weight: normal;
visibility: visible;
}
#two{
font-size:12pt;
position:absolute;
left:128px;
top: 152px;
color:#000000;
z-index:35;
width: 732px;
height: 65px;
font-weight: normal;
visibility: hidden;
}
#apDiv1 {
position:absolute;
left:100px;
top:0px;
width:798px;
height:127px;
z-index:39;
}
</style>
Any suggestions?
I am also using alot of z-indexes -the reason I set it up like this is to have alot of layout flexibilty with my divs and allowing them to be swapped.
My styles look like this:
Is there a way to edit this so that I can center these divs so they reposition themselves for viewers with higher/lower resolutions.
I tried "position: relative;" and "vertical-align:middle;"
<style>
body{
font-family:arial;
background-color: #F6D18D;
}
#bg{
position:absolute;
/*background-image: url(images/bgb.jpg);*/
top:0px;
left:100px;
z-index:2;
width: 800px;
height: 596px;
visibility: visible;
}
#bar{
background-image: url(images/green-nav-bar.jpg);
top:500px;
left:100px;
width: 800px;
height: 20px;
visibility: visible;
position: absolute;
}
b{
text-decoration:none;
color: #FFFFFF;
font-weight: bolder;
}
b:hover{
text-decoration:none;
color: #660000;
font-weight: bolder;
}
a{
text-decoration:none;
color: #FFFFFF;
font-weight: bolder;
}
a:hover{
text-decoration:none;
color: #660000;
font-weight: bolder;
}
#contactus{
position:absolute;
left:537px;
top:574px;
z-index:6;
visibility: visible;
width: 102px;
height: 18px;
}
#bar{
position:absolute;
left:99px;
top:571px;
z-index:5;
width: 801px;
height: 30px;
background-image: url(images/green-nav-bar.jpg);
}
#about{
position:absolute;
left:359px;
top:574px;
z-index:10;
width: 76px;
height: 18px;
visibility: visible;
}
/*account is hidden because it is now in the middle menu not on the bottom */
#account{
position:absolute;
left:638px;
top:575px;
z-index:11;
width: 96px;
height: 20px;
visibility: hidden;
}
#m{
font-size:100%;
position:absolute;
left:160px;
top:274px;
z-index:36;
width: 183px;
height: 21px;
visibility: visible;
}
#n{
font-size:100%;
position:absolute;
left:443px;
top:274px;
z-index:37;
width: 123px;
height: 24px;
visibility: visible;
}
#o{
position:absolute;
left:696px;
top:274px;
color:black;
width: 100px;
height: 24px;
z-index:38;
visibility: visible;
}
#a {
position:absolute;
left:151px;
top: 395px;
color:#000066;
z-index:20;
height: 95px;
width: 171px;
visibility: hidden;
}
#b{
font-size:100%;
position:absolute;
left:352px;
top: 311px;
color:#000066;
z-index:20;
width: 189px;
height: 193px;
visibility: hidden;
}
#c{
font-size:100%;
position:absolute;
left:125px;
top: 123px;
color:#000066;
z-index:30;
width: 735px;
height: 113px;
visibility: hidden;
}
#d{
font-size:100%;
position:absolute;
left:126px;
top: 126px;
color:#000066;
z-index:30;
width: 735px;
height: 70px;
visibility: hidden;
}
#e{
font-size:100%;
position:absolute;
left:127px;
top: 121px;
color:#000066;
z-index:30;
width: 735px;
height: 70px;
visibility: hidden;
}
#f{
font-size:100%;
position:absolute;
left:629px;
top: 309px;
color:#000066;
z-index:35;
width: 189px;
height: 209px;
font-weight: bolder;
visibility: hidden;
}
#one{
font-size:12pt;
position:absolute;
left:128px;
top: 146px;
color:#000000;
z-index:35;
width: 732px;
height: 65px;
font-weight: normal;
visibility: visible;
}
#two{
font-size:12pt;
position:absolute;
left:128px;
top: 152px;
color:#000000;
z-index:35;
width: 732px;
height: 65px;
font-weight: normal;
visibility: hidden;
}
#apDiv1 {
position:absolute;
left:100px;
top:0px;
width:798px;
height:127px;
z-index:39;
}
</style>
Any suggestions?