CSS Positioning help!
- Started
- Last post
- 13 Responses
- jcontonio
I have started my first css layout last night with this new website. It all looks good in Mozilla and Safari, but not in IE on Windows (haven't tested mac).
the URL is http://www.formandfunctionstudio…
In IE WIN the divs are just centered and going straight down the page where it's supposed to be a two column design (as you'll see in Mozilla)
One thing I can't figure out is how to center the whole layout to the page. I tried doing margins of 25% or something but it does nothing.
If anyone can take a look at the stylesheet and tell me what's wrong that would be awesome!
- jcontonio0
sorry about the multiple post. My trackpad is insane.
- mitsu0
you mean center vertically and horizontally?
- Sapphire0
i dunno
maybe try doing a table within a table set to 100% width and height....:/
- sp0
First off, there is no div align="center".
In order to use multiple column layouts in strict DIV markup, you have to use the "float" css property.
An example would be:
col1 {
float:left;
width:200px;
}
col2 {
float:left;
width:200px;
}As far as centering a DIV layout, the correct implementation is:
container {
display:block;
margin:auto;
}
- sp0
Your DOCTYPE is incorrect, too.
- jcontonio0
Well I changed the doctype and changed my nav margin to auto and it's not centered...
I tried adding display : block and margin : auto to the container div and that didn't center it at all either.
For the post about tables, I don't want to use any tables so that's out of the question but thanks. I just want it centered horizontally on the page. and for some reason adding all that to the container dropped my right column a few pixels.
- sp0
Here is the box-model hack tutorials...
http://www.thenoodleincident.com…
And, here is the centering info.
- jcontonio0
I tried adding the certain things they're telling me to do in these tutorials and nothing seems to be working other than it pushing my right column down.
I'll keep hackin away at it but if someone can point out what I am doing wrong that would help.
- sp0
If I get some spare time tonight...I will pound a quick re-write example for you.
See if it will help....but it will be later tonight...I have two pc's to rebuild tonight...and a shit load of project management paperwork and some desktop application architecture to re-work and approve.
But, I'll give it a shot...
- 4cY0
got not much time now__
but here i worked with divs only (css pos.) and blocks (left/right etc..)
http://www.meetinformatiedienst.…
css here:
- CAJTBr0
all looks fine on pc ie 5 here other than it's left aligned and looks like it's supposed to be centered, and the bottom of the main div and the 'business card' aren't aligned.
- jcontonio0
Well I tried more on getting the page centered...no dice. It looks fine on PC IE and every mac browser cept for alignment. I don't get it. I tried the text-align hack, and a bunch of other stuff. I will send over the code to ya now...thanks
- jevad0
sp - great links, thanks! : )