Forum Moderators: not2easy
Say, I put 3 divs. 1 for each column. Then, the first one just leave where it is. The second, relatively position to be to the right of the 1st.....and that's where the problems begin.
I've tried float:right; on the second column (I understand how floats work) but that placed it BELOW and to the right of the 1st column. What?! Lol
And the third column, well that's a problem too. Haha....
I know I could absolutely position the whole thing, but I want the entire layout to only be about 700 pixels wide and centered, which I've done through a container div and gotten to work. It's positioning the three columns inside THAT container that's posing the problem, because I can't absolutely position them for obvious reasons (ie, elements will be outside the container on widescreen monitors.)
I'm sorry if that doesn't make much sense, I really do appreciate any and all help that you can offer though. This is driving me crazy haha.
Also, I have a working version online but I won't post the link here.
#wrapper {
width: 700px;
margin: 0 auto; /* centers content */
padding: 0;
}
#left {
width: 190px;
margin: 0;
padding: 0; /* I zero the padding and create spacing with margin settings */
float: left;
}
#center {
width: 500px;
margin: 0 10px;
padding: 0;
float: left;
}
#right {
width: 190px;
margin: 0;
padding: 0;
float: left;
}
HTML -
<div id="wrapper">
<div id="left">CONTENT</div>
<div id="center">CONTENT</div>
<div id="right">CONTENT</div>
</div>
Remember, the width of a <div> includes the width itself, the margins, and the padding.
Marshall
Is it possible that you may have an error?
you have the wrapper width as 700px while both the left and right are 190px and since both are within the wrapper then is ther not an issue.
should not both the left and right width be 100px thus the width of the wrapper is met?
I think otherwise both the left and right will have an incorrect with
mapleleaf
have a look at the right column
[glish.com...]
mapleleaf
I'm sorry maybe I'm missing something but I don't see a footer in any of the examples. I can know the height of the right column in the layout above if that helps at all.
Here is some that may even help you further <>
I am a firm believer of using all tools available to me and the one tool that is one of the best is Google. You can find anything(info) IF you ask the right question; try typing in your question and see what comes up.
mapleleaf
[edited by: SuzyUK at 9:41 pm (utc) on Sep. 16, 2008]
[edit reason] please no non-authority URI's, see charter at top of page, thanks [/edit]
#footer {
width: 800px;
margin: 0
padding: 0;
text-align: center; /* your choice */
clear: both; /* IMPORTANT clears the floating elements */
}
HTML - ADD after the three columns and before closing the outer wrapper -
<div id="footer">
footer content
</div>
Marshall
CSS Positioning and Layout Techniques have improved greatly since Glish put those samples online (oh my how sad, I can remember when they were NEW :o).. the Float technique used by Marshall and mentioned earlier in this thread is only one way to do a three column layout. The footers are not and will not be present in a layout where AP is used (at least not in Glish as the advanced positioning techniques were simply not in IE's vocabulary back then )
If you do decide to use a generator, please don't blame CSS if your page goes wrong, instead try to blame the fact that sometimes CSS can't be parcelled into a nice neat application - it's not a programming language ;)
anyhow.. pardon my reminder interruption.. and thanks Marshall for the help in this thread ;)