Please Please Help...

They have: 2 posts

Joined: Jan 2006

I have been at this problem for 12 hours (no, seriously). I am making a site through CSS. The CSS and the HTML validates. This is the confusing part. I'm not too familar with relative positioning, and am using absolute instead. My problem is when I go to a different computer (with a different resolution) the text is messed up.

I need to know if anyone can end my misery of all of today and last night and tell me how to make it look the same on different browsers or resolutions. I am praying that someone knows for the sake of my well being. Smiling

site found at: http://www.inbinghamton.com/sitecss.html

my css is:

#container{
position: absolute;
left:50%;
margin-left: -313px;
top:45px;
width:766px;
height:716px;
background-image: url(images/sitecssbg.jpg);
}

body{
font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
background-color:#477BA3;
}

#logo {
position:absolute;
width:450px;
height: 49px;
left: 58px;
top: 48px;
z-index:1;
}

#navbar {
position:absolute;
width: 260px;
height: 17px;
left: 289px;
top:184px;
z-index:1;
}

#google{
position:absolute;
width: 160px;
height: 17px;
left: 735px;
top: 330px;
}

#homenav{
position:absolute;
width: 126px;
height: 47px;
left: 289px;
top: 184px;
}

#leftpic{
position:absolute;
width:204px;
height: 96px;
left: 68px;
top: 170px;
}

#centerpic{
position:absolute;
width:204px;
height: 96px;
left: 281px;
top: 170px;
}

#rightpic{
position:absolute;
width: 204px;
height: 96px;
left: 493px;
top: 170px;
}

#bottomleft{
position:absolute;
width: 168px;
height: 96px;
left: 468px;
top: 515px;
font-size:0.8em;
}

#sitesearch{
position:absolute;
width:154px;
height: 29px;
left: 493px;
top: 170px;
}

#searchbar{
position:absolute;
width:194px;
height: 29px;
left: 290px;
top: 364px;
}

#nextweek{
position:absolute;
width:170px;
height: 29px;
left: 468px;
top: 415px;
font-size:0.8em;
}

#welcome{
position:absolute;
width:400px;
height: 90px;
left: 655px;
top: 455px;
font-size:0.8em;
}

Roo's picture

She has: 840 posts

Joined: Apr 1999

You need to you relative positioning. See when you use absolute, that's exactly what it is...*absolute*. So when you've told a div that it is to sit say 400 pixels from the top, and 400 pixels from the left then that is where it will sit. Then when you have a change in res the absolutly positioned elements stay where you told them too, except now the dimentions of the window has chnaged.

With relative positioning the element is xx px *relative* to it's starting position...that means that no matter what res the end user is using the element will be positioned properly.

You can use absolute positioning when if you used a fixed sized layout, but not when using a fluid layout.

Roo

Roo's picture

She has: 840 posts

Joined: Apr 1999

BTW....just use the word relative instead of absolute in your css file.

They have: 12 posts

Joined: Jan 2006

Is the only difference between absolute and relative simply the word? I tried to just change the word and it still didn't show up right?

Please respond if you know, you'd save my life since its due tonight.

Thanks in advance,
scott

demonhale's picture

He has: 3,278 posts

Joined: May 2005

ok what resolution and browser are you using that your site display correctly... so that we know what you want your site to look like position-wise

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

Also note, when you're using position:relative; the top, left, right, bottom elements don't really work. You will have to use margins.

They have: 12 posts

Joined: Jan 2006

So can you give me an example of what relative might look like? Is it just like absolute?

I need the site to look the same on different resolutions. I use two, both bigger then 800 by 600. If you go to the site (inbinghamton.com/sitecss.html) you'll see that things are messed up. I'm wondering how to get that right on your computer and on mine.

thanks. (especially for responding)

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.