<?xml version="1.0"?>
<rss version="2.0">
 <channel>
  <title>Float problems. | WPDFD.com Forums</title>
  <link>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/</link>
  <description>A Layout forum thread at WPDFD.com</description>
  <language>en-us</language>
  <pubDate>04/22/04, 113 23 2004 2004:%i:1082636585 08:23:05</pubDate>
  <lastBuildDate>06/07/13, 158 50 2013 2013:%i:1370595031 04:50:31</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>NineLabs Framework Feed Generator</generator>
  <managingEditor>sitemaster@wpdfd.com</managingEditor>
  <webMaster>sitemaster@wpdfd.com</webMaster>
     <item>
    <title>Kaa  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p799</link>
    <description><![CDATA[Hello there. This was the first time I've done any CSS before but I think I'm getting the hang of it, kind of <img src="/images/emoticons/sidesmile.png" class="smiley" /><br /><br />Basically I'm just trying out a few layout ideas and I tried using floats for placement. Here's the html of it:<br /><br />[pre]<br />&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;<br /><br />&lt;html&gt;<br />&lt;head&gt;<br />&lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;&lt;/style&gt;&lt;!--<br />body {<br /> &nbsp; &nbsp; &nbsp;font-family: Verdana, Geneva, Arial, sans-serif;<br /> &nbsp; &nbsp; &nbsp;color: #565f55;<br /> &nbsp; &nbsp; &nbsp;background-color: #e8eae8; }<br /> &nbsp; &nbsp; &nbsp;<br />#page {<br /> &nbsp; &nbsp; &nbsp;margin-top: 10px;<br /> &nbsp; &nbsp; &nbsp;overflow: auto;<br /> &nbsp; &nbsp; &nbsp;font-size: 11px;<br /> &nbsp; &nbsp; &nbsp;line-height: 14px;<br /> &nbsp; &nbsp; &nbsp;background-color: #d5d5de;<br /> &nbsp; &nbsp; &nbsp;text-align: center;<br /> &nbsp; &nbsp; &nbsp;visibility: visible;<br /> &nbsp; &nbsp; &nbsp;margin-right: auto;<br /> &nbsp; &nbsp; &nbsp;margin-left: auto;<br /> &nbsp; &nbsp; &nbsp;position: relative;<br /> &nbsp; &nbsp; &nbsp;width: 600px;<br /> &nbsp; &nbsp; &nbsp;padding: 5px;<br /> &nbsp; &nbsp; &nbsp;z-index: 1 }<br /> &nbsp; &nbsp; &nbsp;<br />#logo {<br /> &nbsp; &nbsp; &nbsp;background-color: #FFB108;<br /> &nbsp; &nbsp; &nbsp;float: left;<br /> &nbsp; &nbsp; &nbsp;position: relative;<br /> &nbsp; &nbsp; &nbsp;width: 130px;<br /> &nbsp; &nbsp; &nbsp;height: 130px;<br /> &nbsp; &nbsp; &nbsp;z-index: 3 }<br /><br />#cover {<br /> &nbsp; &nbsp; &nbsp;background-color: #DDFFDD;<br /> &nbsp; &nbsp; &nbsp;float: right;<br /> &nbsp; &nbsp; &nbsp;position: relative;<br /> &nbsp; &nbsp; &nbsp;width: 465px;<br /> &nbsp; &nbsp; &nbsp;height: 130px;<br /> &nbsp; &nbsp; &nbsp;z-index: 2 }<br /><br />#menu {<br /> &nbsp; &nbsp; &nbsp;background-color: #669A8E;<br /> &nbsp; &nbsp; &nbsp;position: relative;<br /> &nbsp; &nbsp; &nbsp;width: 100%;<br /> &nbsp; &nbsp; &nbsp;height: 20px;<br /> &nbsp; &nbsp; &nbsp;z-index: 2 }<br /><br />#content {<br /> &nbsp; &nbsp; &nbsp;background-color: #D1E4C9;<br /> &nbsp; &nbsp; &nbsp;float: left;<br /> &nbsp; &nbsp; &nbsp;position: relative;<br /> &nbsp; &nbsp; &nbsp;top: 3px;<br /> &nbsp; &nbsp; &nbsp;width: 445px;<br /> &nbsp; &nbsp; &nbsp;height: 100%;<br /> &nbsp; &nbsp; &nbsp;z-index: 2 }<br /> &nbsp; &nbsp; &nbsp;<br />#sidebar-right {<br /> &nbsp; &nbsp; &nbsp;background-color: #D1E4C9;<br /> &nbsp; &nbsp; &nbsp;float: right;<br /> &nbsp; &nbsp; &nbsp;position: relative;<br /> &nbsp; &nbsp; &nbsp;top: 3px;<br /> &nbsp; &nbsp; &nbsp;width: 152px;<br /> &nbsp; &nbsp; &nbsp;height: 100%;<br /> &nbsp; &nbsp; &nbsp;z-index: 2 }<br /><br /><br />--&gt;&lt;/style&gt;<br /><br /> &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp;&lt;title&gt;test layout&lt;/title&gt;<br />&lt;/head&gt;<br /><br />&lt;body&gt;<br /> &nbsp; &nbsp; &nbsp;&lt;div align=&quot;center&quot;&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;div id=&quot;page&quot;&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;div id=&quot;logo&quot;&gt;logo&lt;/div&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;div id=&quot;cover&quot;&gt;cover&lt;/div&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;div id=&quot;menu&quot;&gt;MENU&lt;/div&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;div id=&quot;content&quot;&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Proin non ipsum a nisl lacinia pulvinar. <br />Proin accumsan. Maecenas id odio. Praesent dictum. Cras malesuada. Aenean blandit vehicula diam. Phasellus feugiat fringilla pede. <br />Suspendisse tempor nunc in dolor. Quisque lorem ipsum, venenatis quis, interdum vel, mattis nec, lacus. Aliquam erat volutpat. <br />Morbi ut enim. Quisque tristique quam id risus. Curabitur vel quam sit amet purus viverra dapibus. Ut at lectus. Aliquam malesuada est <br />eget sapien. Aliquam volutpat tortor non odio. Vestibulum dapibus velit a dui facilisis vulputate. Nullam placerat. Maecenas dignissim <br />vestibulum sapien. Pellentesque pede ligula, congue at, scelerisque eu, imperdiet sit amet, tellus.<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/p&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/div&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;div id=&quot;sidebar-right&quot;&gt;sidebar&lt;/div&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;div&gt;copyright rubbish&lt;/div&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/div&gt;<br /> &nbsp; &nbsp; &nbsp;&lt;/div&gt;<br />&lt;/body&gt;<br />&lt;/html&gt;<br />[/pre]<br /><br />This almost works perfectly in internet explorer (apart from the sidebar not being the same size as the content box).<br /><br />In Opera the sidebar problem is there and the menu bar seems to stick to the top of the page.<br /><br />In firefox the page looks awful, although the dimentions of the boxes seem to be correct (even the sidebar was renered as it should have been, which is nice).<br /><br />Your help would be much appreciated, thanks.]]></description>
    <pubDate>04/22/04, 113 23 2004 2004:%i:1082636585 08:23:05</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p799</guid>
   </item>
     <item>
    <title>Baxter  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p800</link>
    <description><![CDATA[Couple of things:<br /><br />Floats must come BEFORE the stuff they're floating next to. So sidebar right must come before the other stuff.<br /><br />You've assigned several things a z-index of 2, which is basically asking them to occupy the same space. Probably not your problem, but not really something you want to do, either.<br /><br />The misized boxes sound like an IE &nbsp;box model problem.]]></description>
    <pubDate>04/22/04, 113 44 2004 2004:%i:1082641485 09:44:45</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p800</guid>
   </item>
     <item>
    <title>Kaa  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p801</link>
    <description><![CDATA[Thanks for the help baxter. Seemed to have fixed a few things. But I have a whole new problem now &nbsp;:<img src="/images/emoticons/smile.png" class="smiley" /><br /><br />The problem I have is that I have two columns side by side, One for content and one for other stuff (like polls and things) and I wish to have them the same height. Their height depends on their contents, but I want both columns to adapt to the column with the larger content.<br /><br />So what I want is to make the right column the same height as the left column. Usually (but not always) the content of the left column is taller than the right.<br /><br />And also I want the whole page to be in one giant box, &nbsp;which adapts to the size of the content.<br /><br />I'm banging my head against the wall trying to figure out how to do this, I'm sure I'm going to kick myself when I find out how it's done.<br /><br />I know I could use an HTML table to do this, but that's what I'm trying to escape with css (*rembers using invisible gifs for layout &nbsp;<img src="/images/emoticons/sharptear.png" class="smiley" />*)]]></description>
    <pubDate>04/24/04, 115 10 2004 2004:%i:1082844637 18:10:37</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p801</guid>
   </item>
     <item>
    <title>Joe Gillespie said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p802</link>
    <description><![CDATA[I'm not sure what you mean by two columns the same height. The only way you can get two columns of text the same height is to put the same text in them. There's no concept of column-flow in HTML or CSS so the bottom edge of any text will be at an arbitary position depending on the number of words and text size. <br /><br /><a href="http://www.wpdfd.com/editorial/wpd0403b.htm#feature">http://www.wpdfd.com/editorial/wpd0403b.htm#feature</a> shows how I turned WPDFD from a table-based to CSS-based layout with two columns - actually, there are three but one is only for the section headers. <br /><br />The is an overall div for the whole page which is a fixed width but says centred on the window because the margins are set to auto. You can do the opposite, fix the margins and make the div stretch if you like.<br /><br />If you put two 'float: left' coumns inside that with their witdths set to 50%, you will get the fluid two column layout.<br /><br />To get text to line up in left and right columns, I break the columns up into shorter ones with a full width 'spacer' div that gives a new top for each pair of columns. The diagram should be self explanitory.<br /><br />To provide the illusion of the left and right columns being the same height, you can put a footer at the bottom (or one on each side like I do on the WPDFD home page. That way, you get white space making up the difference in column lengths.<br />]]></description>
    <pubDate>04/25/04, 116 42 2004 2004:%i:1082882575 04:42:55</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p802</guid>
   </item>
     <item>
    <title>Kaa  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p803</link>
    <description><![CDATA[Thanks for the reply, it wasn't quite what I was getting at but I did learn something from it at least, I didn't know you could center elements by setting margins to auto, I had previously been wrapping a div around everything and setting align to center, so I'll try using this new method.<br /><br />Hmm... I guess the best way to explain what I'm on about is to use a drawing:<br /><br /><img src="http://www.boomspeed.com/houseofbobat/layout.JPG" /><br />(gotta love MS paint ;D)<br /><br />It's probably not possible to make an element's height behave like that, but is there a way to at least make it &nbsp;<i>look</i> like this?<br /><br />Thanks in advance.<br /><br />(by the way, I decided to scrap the code I made at the &nbsp;begining of this thread, I've made a new version at <a href="http://www.boomspeed.com/houseofbobat/template.html">http://www.boomspeed.com/houseofbobat/template.html</a>, now it works in all the main browsers... I think)]]></description>
    <pubDate>04/25/04, 116 52 2004 2004:%i:1082919127 14:52:07</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p803</guid>
   </item>
     <item>
    <title>Joe Gillespie said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p804</link>
    <description><![CDATA[As far as I can see, you only have a problem if the columns have background colours. If you leave one of the columns with a transparent background, then you can't tell that they aren't the same height.<br /><br />Realistically, the only way to get what you are after is with tables but if that's what you want, then use a table, it can still be valid, it's not a crime! Some designs still require the use of tables and certain functions, such as valign=&quot;center&quot; or valign=&quot;bottom&quot; are still not easily achievable in CSS.]]></description>
    <pubDate>04/25/04, 116 35 2004 2004:%i:1082928902 17:35:02</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p804</guid>
   </item>
     <item>
    <title>Kaa  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p805</link>
    <description><![CDATA[Yeah, I thought I'd might have to use a table to get that effect. Although I could experiment with that idea of transparent backgrounds and have the content and the sidebar in one giant &quot;block&quot; or something. Thanks for the help anyways.]]></description>
    <pubDate>04/25/04, 116 53 2004 2004:%i:1082933596 18:53:16</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p805</guid>
   </item>
     <item>
    <title>Kaa  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p806</link>
    <description><![CDATA[Hang on, I think I've actually done it!<br /><br />What I did was make a div element wrap around both columns and give it the colour of the background I wanted for both columns. Then for the content column I set the border-right to the same colour as the background colour. And I made the sidebar transparent (as you suggested).<br /><br />The result is the illusion that there are two separate columns which are the same height. I've put it up here: <a href="http://www.boomspeed.com/houseofbobat/template.html">http://www.boomspeed.com/houseofbobat/template.html</a><br /><br />The only way I can see this method failing is if I want to make the columns a different colour.<br /><br />Either way, I've managed to do it, thanks for the help guys! &nbsp;;D]]></description>
    <pubDate>04/25/04, 116 50 2004 2004:%i:1082937018 19:50:18</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p806</guid>
   </item>
     <item>
    <title>Joe Gillespie said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p807</link>
    <description><![CDATA[To make the right column a diffent colour, you can use a background image for the wrapper div. Just a sliver of a GIF with two colours the correct width and set to repeat-y would do the trick.]]></description>
    <pubDate>04/26/04, 117 54 2004 2004:%i:1082966083 03:54:43</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p807</guid>
   </item>
     <item>
    <title>Kaa  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p808</link>
    <description><![CDATA[Ah excellent, looks like I've managed to get the layout I wanted. I'm beginning to like all this css now. Thank you for the help everyone.]]></description>
    <pubDate>04/26/04, 117 44 2004 2004:%i:1083005075 14:44:35</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p808</guid>
   </item>
     <item>
    <title>Baxter  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p809</link>
    <description><![CDATA[Yes, putting a background for BOTH columns on the background wrapper div is probably the most common, and easiest way, to get full-height columns. There's also some neat solutions that use a clearing element (say, &lt;br style=&quot;clear:both&quot; /&gt; to do it, but they're a little harder to wrap the old bean around.]]></description>
    <pubDate>04/27/04, 118 44 2004 2004:%i:1083095099 15:44:59</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p809</guid>
   </item>
     <item>
    <title>Jason_stanfill  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p810</link>
    <description><![CDATA[the background image is a great solution and is described more at A List Apart http://www.alistapart.com/articles/fauxcolumns/ <br />]]></description>
    <pubDate>05/12/04, 133 29 2004 2004:%i:1084390144 15:29:04</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/float_problems/#p810</guid>
   </item>
   </channel>
</rss