pioneerx01 Posted March 30, 2013 Share Posted March 30, 2013 Hi, I am working with this CSS: #list_container { overflow:hidden; } #list_c1 { width:200px; float:left; } #list_c2 { width:200px; float:left; } #list_c3 { width:200px; float:left; } and I have the following code: echo "<div ID='main_container'>"; echo "<div ID='list_container'>"; echo "<div ID='list_c1'>"; echo "column 1 text"; echo "</div>"; echo "<div ID='list_c2'>"; echo "column 2 text"; echo "</div>"; echo "<div ID='list_c3'>"; echo "column 3 text"; echo "</div>"; echo "</div>"; echo "</div>"; When I open this in the browser the column 1 is next to column 2 which is next to column 3. However when I print they are all under each other. How do I go about correcting that? I assume that I need to add comething to CSS? Thanks Link to comment https://forums.phpfreaks.com/topic/276312-aligment-of-divisions-for-printing-problems/ Share on other sites More sharing options...
Love2c0de Posted April 4, 2013 Share Posted April 4, 2013 Just a long shot to be honest, but instead of floating your <div> elements left to get your desired result, you can set the #list_container to display any children <div>'s as inline-block elements. This means you will get exactly the same result as before but it could possibly sort your printing problem. I can't get to my printer right now (more like too lazy, it's in the other office) but give this code a try: CSS: #list_container { overflow:hidden; } #list_container > div { display: inline-block } #list_c1 { width:200px; } #list_c2 { width:200px; } #list_c3 { width:200px; } I hope this helps you. Good luck. Kind regards, L2c. Link to comment https://forums.phpfreaks.com/topic/276312-aligment-of-divisions-for-printing-problems/#findComment-1422915 Share on other sites More sharing options...
BuildMyWeb Posted April 7, 2013 Share Posted April 7, 2013 i think the problem is in your containers. float elements are pulled out of the flow. Link to comment https://forums.phpfreaks.com/topic/276312-aligment-of-divisions-for-printing-problems/#findComment-1423356 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.