Positioning with CSS in HTML
Okay, I have been playing with this for a while and thought I would ask for some help. I am a hobbiest that types code for my html pages for what it is worth. I am trying to convert from tables to CSS. Mainly because I like some of the options CSS provides. Particularly with Java. Anyway...
I am wanting to make a page that is centered in the browser. At the same time, I want a title banner, left navigation and body elemtent as well. Below is an example of the layout. Each box is currently a <DIV> tag. Ideally the entire thing would be centered (horiz.) and everything inside would stay relative. Code:
+-------------------------+ I was hoping for some suggestions on how to do this the cleanest and for the most browsers. I don't like the idea of using java to determine browser and writting an entire page for each. Well, thanks for the help. I look forward to hearing your suggestions. PhilD P.S. Code examples would be great!! |
Have you looked at http://glish.com/css/
Its hard to advise without any idea how you where doing it. Code:
HTML |
I remember having to resort to javascript when wanting absolution positioning from the centre of a page, but in this case pure CSS positioning, or maybe some javascript page dimentions calculations would work.
|
I think you want somehitng like:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> |
floats are cool but in IE if you make the window really small, the floats get all out of whack. for example, go here: http://www.wmucradio.com/new_page and make the window about half the size of the screen (if you happen to be using IE) and you see that the left bar drops for some reason. i have no idea why this is and i am using floats.
|
Try getting rid of all the html errors and it may work better.
If you don't tknow what I mean then try running the source through tidy: http://tidy.sourceforge.net/ |
ran it through, didn't have any errors. just a bunch of warnings. i dunno what to do about that column dropping
|
Thank you all for your replies. I have been swampped with work and school just starting back. When I have some time I will try to post a test page I was working with on my own. I will also work through some of the examples you provided.
If you are currious, the page I am wanting to redo and center is linked below... http://www.geocities.com/phil41dean/deans/home.html Sorry for the geocities adds. One day I will get my own domain. Again, thanks for the help. PhilD |
All times are GMT -5. The time now is 10:12 AM. |