April 7, 201115 yr Hi I have created a background image for my header, content and footer in my WP theme, which works fine on the Home page. but for the internal page with sidebars such as this, its not showing the content background. Actually it not got a #content, but the page.php and single.php pages both have the same start and finish as the index.php, so shouldn't the content be there aswell ? I does work for the 'fullwidth' template option but not for the page with sidebar ? thanks I appreciate your time, please let me know if you need more information. Ashley Edited April 7, 201115 yr by Acknowledged74
April 7, 201115 yr You need to clear the floats before the closing content div <div class="clr"> </div> .clr{clear:both;width:100%;height:0;font-size:0;} or you can use overflow I use the clear myself #content{overflow:auto;}
April 7, 201115 yr Author You need to clear the floats before the closing content div <div class="clr"> </div> .clr{clear:both;width:100%;height:0;font-size:0;} or you can use overflow I use the clear myself #content{overflow:auto;} As I said if you look at the actual internal page online (source view) there isn't a id="content" to style, just a "wrapper" and "inner"? thanks for the reply by the way. Edited April 7, 201115 yr by Acknowledged74
April 7, 201115 yr Author There doesn't seem to be a id="content" only "wrapper" and "inner", and I don't understand why. If you view source for the home page and any other page you can see the difference, but they have the same header and footer, which start and finished the "content" tag, so where is it? I did try overflow:auto; but that has caused several other issues, so definitely not the answer. Edited April 7, 201115 yr by Acknowledged74
April 8, 201115 yr There doesn't seem to be a id="content" only "wrapper" and "inner", and I don't understand why. If you view source for the home page and any other page you can see the difference, but they have the same header and footer, which start and finished the "content" tag, so where is it? I did try overflow:auto; but that has caused several other issues, so definitely not the answer. There definitely is a div#content, and that's the problem. On your homepage you have a single column within the content. Your sidebar pages contain two columns within div#content, which are arranged by the float property. This means that they are taken out of the height calculation for their containing element. I've seen what happens when you add overflow: auto to div#container - your content jumps to the far right. That's a separate problem and needs to be addressed as such; setting overflow: auto on div#container is the correct solution to this problem. Start by validating your markup - you've served it as XHTML, but omitted the closing slash from self-closing tags. Once your markup is valid, move on to squashing bugs. Ok, setting overflow: auto on both div#inner and div#content reveals the problem - something in div#content has a wrongly-calculated width, which is causing div#inner to overflow, as evidenced by the horizontal scrollbar. Edited April 8, 201115 yr by Renaissance-Design
April 8, 201115 yr Perhaps I am not understanding the problem correctly, but can you not just add float:left to your content div
April 8, 201115 yr Nailed it. Complete solution in 3 easy steps: Add 1px of width to div#wrapper - it's currently 990px whereas the content is adding up to 991px Add overflow: auto to div#content Remove the float from div#header - it doesn't need it, and that's what was causing the content to wrap to the right Edited April 8, 201115 yr by Renaissance-Design
April 8, 201115 yr Mr Renaissance do you prefer using overflow method vs the clear? Always use the clear myself its a little extra mark up but its the way I've always done it
April 8, 201115 yr Mr Renaissance do you prefer using overflow method vs the clear? Always use the clear myself its a little extra mark up but its the way I've always done it Way I look at it is, if it can be achieved without extra markup it's a plus. Means you have to watch contained elements for width, but that's no big deal.
April 10, 201115 yr Author Great thanks for all your help it was very simple, as often is the case, change widths to 991px, I though I had made the bg images 990px, and never checked back. thanks again case closed.
Create an account or sign in to comment