Jump to content

css div quetion

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
Root23

Root23

    Programmer

  • Members
  • PipPipPipPip
  • 144 posts
I've got a question regarding a page layout...

I made this site layout.. that started out as a fixed width / center in browser page like a lot of sites tend to be. Then I decided to go a different route because I didn't want the page to be fixed width. However, now that I've got it setup this way it doesn't look right when stretched out on higher resolutions. So, I'm thinking of converting it back to fixed width.

However, with the layout I have right now I've got it so that the divs are fixed. I have the header & footer on 'top', and the content is underneath with padding to clear the header and footer. This way when the scroll bars are used the content scrolls, but the header/footer stay in place. I still want it to do this when I convert it back to a fixed width / center in browser, but I'm not sure how to go about it now that I won't be using fixed divs.

Any ideas? Is it doable?
Posted Image

#2
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
Post the code/link.

I'd suggest a wrapper div. You'd basically put a div around all the content with a set width and set the left and right margin to auto.

If that doesn't work post the code and I'm sure somebody will help you out! :]

#3
Root23

Root23

    Programmer

  • Members
  • PipPipPipPip
  • 144 posts
Well, getting it centered on the page isn't my problem. I've got a wrapper that's holding everything except for the footer, this is so that I can keep the footer at the bottom regardless if there's any content on the page. Both have left & right margin to auto to keep it centered.

What I was wanting to do is somehow keep the logo/navigation from scrolling with the rest of the page. Essentially keeping it fixed, without using a fixed div (since I can't if I want to keep it centered). This was easy to do when I had everything set with fixed divs. Thanks for trying to help though!
Posted Image

#4
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
Why not put the content and footer in a scrollable div?

I'm sure it's possible to keep it stuck and centered if you can get it stuck. How are you keeping it up now?

I remember a user on another forum years ago who went by "root 32" any relation?

#5
Root23

Root23

    Programmer

  • Members
  • PipPipPipPip
  • 144 posts
No relation here.

Yeah I could just put scroll bars on the content div itself now that you mention it, but for aesthetic reason I'd rather not. I'm thinking what I want to do is only going to work with fixed divs, or unless I used javascript (which I don't know) to make the main scroll bar only work for the content div.
Posted Image