HighDots Forums  

Re: Simple Question (2 column layout)

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Re: Simple Question (2 column layout) in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim Roberts
 
Posts: n/a

Default Re: Simple Question (2 column layout) - 04-17-2004 , 03:11 AM







"Alfred" <omyek (AT) yahoo (DOT) com> wrote...

Quote:
The problem with my CSS is that if the main content's height is less
than the side content's height, the side content will wrap underneath
the main content instead of staying within the 25% bounds.

-me

------ code
#main
{
float: left;
width: 75%;
}

#side
{
}

Stylesheet:

#main {
width: 75%;
}

#side {
float: right;
width: 25%;
}

html:

<div id="side">
content
</div>

<div id="main">
content
</div>

Putting the #side div first, which is floated to the right, will allow
the main content to flow around it. The #side content will not flow
outside of it's declared width.

Regards,
Jim



Reply With Quote
  #2  
Old   
Jim Roberts
 
Posts: n/a

Default Re: Simple Question (2 column layout) - 04-17-2004 , 03:20 AM







"Jim Roberts" wrote...
Quote:
Stylesheet:

#main {
width: 75%;
}

[snip]
correction:

Either remove width: 75% from #main or add float: left;. Without this
modification, it did not work correctly in IE, although it seemed fine
in Mozilla.

#main {
width: 75%;
float: left;
}

or

#main {
/* other declarations */
}

Jim



Reply With Quote
  #3  
Old   
Alex
 
Posts: n/a

Default Re: Simple Question (2 column layout) - 04-19-2004 , 10:33 PM



Thanks for your suggestions Jim. For some reason, only one of your
suggestions worked. (the one below. using IE6/Win in Standard mode) But
it worked, nonetheless. And with CSS, it almost seems best not to ask why.


#main
{
float: left;
width: 75%;
}

#side
{
float: right;
width: 25%;
}

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.