Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Internal WP pag not showing #content, with its background ?

Featured Replies

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 by Acknowledged74

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;}

  • 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 by Acknowledged74

  • 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 by Acknowledged74

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 by Renaissance-Design

Perhaps I am not understanding the problem correctly, but can you not just add float:left to your content div

Nailed it. Complete solution in 3 easy steps:

 

  1. Add 1px of width to div#wrapper - it's currently 990px whereas the content is adding up to 991px
  2. Add overflow: auto to div#content
  3. 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 by Renaissance-Design

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

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.

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.