March 30, 201313 yr Hello, I've got a simple layout issue with my website that will be a css code fix I think, however I am unsure on what to do. The problem I am having is a page is made up of a main container, which contains a left and right content. The left, contains a product on sale and all relevant information, and the right content is for other information I choose to put up, such as an information menu or related items. The problem I am having is, I have a banner above this content however this doesn't seem to affect the main container. The left content moves down with this banner, however the right content does not. I can fix this with a simple margin-top however on pages without the banner above the content, this right content div is moved down by this margin-top. This creates a problem as on some pages the right banner has been moved and looks messy. Changing the div id for pages with a banner and pages without is not an option either unfortunately. Is there a way of fixing this. I have examples below. Page WITH a banner in line: PRODUCT PAGE Page WITHOUT a banner and out of align: ACCOUNT PAGE Solutions are appreciated! Link to webpage: www.SugarSkullUK 'dot' com Thanks Edited March 30, 201313 yr by lcot
March 31, 201313 yr This how I would do it move the banner div the breadcrumb div & the h1 into the container before the column right starts
March 31, 201313 yr Author This is the code I have to work with... <?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?> <div id="content"><?php echo $content_top; ?> <div class="breadcrumb"> </div> <h1><?php echo $heading_title; ?></h1> etc and then the rest is the content and the footer for the page... What the above solution does by moving the <div id="content"> to after the header, this disconnects the margins that the container section has with the right column so now the left content overlays the right column slightly. Edited March 31, 201313 yr by lcot
March 31, 201313 yr post the column_left.php code I'm guesing that will be where the container is being pulled in from
March 31, 201313 yr Author Ofcourse... The code of the column-left: <?php if ($modules) { ?> <div id="column-left"> <?php foreach ($modules as $module) { ?> <?php echo $module; ?> <?php } ?> </div> <?php } ?> And the CSS: /* layout */ #container { width:940px; margin-left: auto; margin-right: auto; text-align: left; padding:0px 0 0 0; margin-bottom:28px; overflow:hidden; } #column-left { float: left; width:220px; } #column-right { float: right; width:180px; margin-bottom:0px; margin-top: 140px; } #content { min-height: 400px; margin-bottom:0px; padding-top:0px; padding-left:0px; padding-right:20px; } .common-home #content { padding-right:0;} #column-left + #column-right + #content, #column-left + #content { margin-left:220px; } #column-right + #content { margin-right:180px; } Edited March 31, 201313 yr by lcot
April 3, 201313 yr If I understand it correctly your problem is that the banner doesnt push the content down the way it should? your content is floated, and thus outside of the normal flow, a clear:both; in the css for the banner might just fix it.
April 3, 201313 yr Author No, unfortunately this clear:both css does not change anything with the layout on the page... This is a puzzle for me! It's bound to be something simple in front of me but I can't seem to see it. Any more ideas?
April 3, 201313 yr Hey, what you need to do is firstly move the column-right div inside the main content div and float it to the right so that the main content div consists of #box-container (floated left) and #column-right (floated right). Here's a quick summary: <div id="content"> <!-- banner div code and scripts etc --> <!-- breadcrumb div code --> <div class="box-container"></div> <div id="column-right"></div> </div> You also need to add the following CSS: .box-container { background: url(../image/box-bg.png); padding: 10px; float: left; /* I ADDED THIS */ } #column-right { float: right; } This does the trick for me, I've attached a screenshot to show you: Hope this helps, Lyndsey.
April 3, 201313 yr So I've had a good look at your website,I think I know where you had put your banner. in the div #notification. Now, what I would recommend you to do is, move that dive outside of the container so that it looks like this: <div class="main-container"> <p id="back-top"> <a href="#top"><span></span></a> </p> <div id="notification"> </div> <div id="container"> <!-- you dont need to add this, but this was it's position before i moved it --> <div id="column-right"> doing this will make the banner push the entire container down when you add it. So it wont affect the positioning of your floated elements Edited April 3, 201313 yr by Tieskevo
April 3, 201313 yr Sorry I forgot to check back the other day I've sent you a msg as what can look like a easy fix this end might not be as simple locate where the code is being pulled in from
April 4, 201313 yr Author Ha, mteam, I did actually write a nice PM reply for you but I still need another 8 more approved posts before I can respond.But, thank you for your help so far! I welcome it on this next puzzle..Also, lyndsey, thank you for the fix. Worked a treat (NEARLY)...The problem with this fix is that it doesn't correct the main content's width value throughout different pages. Now, for example on the account page, the box-container with the white background does not stretch to the width to the content-right. It only stretches to the width of the text it contains. However, on the affiliate page, the layout has messed up with the above fix. (For now, I have kept it how it was but I have screenshotted). Edited April 4, 201313 yr by lcot
April 8, 201313 yr Author I am just writing this, so I can lift my restriction to allow me to contact mteam, who has kindly offered to assist in a private message.
April 8, 201313 yr Author I am just writing this, so I can lift my restriction to allow me to contact mteam, who has kindly offered to assist in a private message.
April 8, 201313 yr Author I am just writing this, so I can lift my restriction to allow me to contact mteam, who has kindly offered to assist in a private message.
April 8, 201313 yr Author I am just writing this, so I can lift my restriction to allow me to contact mteam, who has kindly offered to assist in a private message.
April 8, 201313 yr Author I am just writing this, so I can lift my restriction to allow me to contact mteam, who has kindly offered to assist in a private message.
April 8, 201313 yr Author I am just writing this, so I can lift my restriction to allow me to contact mteam, who has kindly offered to assist in a private message.
Create an account or sign in to comment