467,915 Members | 1,196 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

CSS problems

Hi everyone!

Time for my first post here at the scripts :D

Currently working on a homepage for a little project I'm working on. I'm not really a web site-making wizard but since I don't have anyone to do it for me (since it's a one man project), I did it myself and of course the road have been bumpy up to this point. Now I've come to a stand still, I can't solve or find an answer to my problems so I hope you guys can help me!

The page in question

and the problems is:
- the sides of the content don't extend all the way down (I've put "height: 100px;" to them now because otherwise they don't show at all...). Is there a way to have them at the same height as the content?
- There's a big blank space to the right, I guess that it's there because of my way of centering... I've tried other ways of centering which solves the space-problem but they don't center the page...
- The page don't extend down to the bottom of the window if the content is too small.

Would really appreciate if someone could take a minute to help me.

Apr 14 '07 #1
  • viewed: 1145
3 Replies
Expert 4TB
There are a couple of things you will have to play with to make this right.

You must specify the actual height and width of div for it to expand but there is no content. So the div collapses to the actual size of the background image which is why you don't see it unless you give it that height.

The way to get this div to expand to the full height of the containing div is to say 'height:100%'. The problem ,though, is the browser is going to ask "100% of what?" and the answer is the height of the parent of your border div. However, you don't specify anything there so the browser works its way up the tree and doesn't find anything there either.

So the best thing to do is make sure html and body are both set to the height of the browser viewport:

Do the same for the parent of your border div and the border itself and..............that doesn't work. Why? Now it gets tricky.

Some of the divs above this are absolutely positioned. Absolute positioning removes the element from the normal flow so any height set there won't affect the children it contains.

And this, my friend, I leave as an exercise to the reader.
Apr 14 '07 #2
Thanks for your help!

I've changed the absolute positioned div to relative and set height to 100% of all the parent div and problem solved! :D but a new one arose... :/

The new one..

Now the page extends to much.. do you know how to solve this?

You maybe also know how to solve the other problem, that it extends to the right?

Thank you again!

Apr 15 '07 #3
Expert 4TB
You have #center set at 50% of the width.
Apr 15 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Jerome Lefebvre | last post: by
14 posts views Thread by Jim Hubbard | last post: by
5 posts views Thread by Corky | last post: by
2 posts views Thread by Ellen Graves | last post: by
reply views Thread by Sergistm | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.