Title: CSS Background width
Last modified: August 19, 2016

---

# CSS Background width

 *  [rosemckay](https://wordpress.org/support/users/rosemckay/)
 * (@rosemckay)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/css-background-width/)
 * Hello,
    I’m using the default template to customize a new theme and rather than
   using only the standard template files ie. header, sidebar, footer, I added an
   additional template file I called “secondrow.php” because the design of the layout
   has a header stacked above the content, stacked above a second row of content
   which is stacked above another third row (I intend to use the sidebar.php for
   the third row of content) and then the footer.
 * This new secondrow.php template file calls into the template perfectly and seems
   to be working fine. The problem is that I’m having problems with styling it. 
   In the css file there is this bit of code:
 *     ```
       #page {
       	background-color: white;
       	position: absolute;
       	margin-left: -475px;
       	left: 50%;
       	width: 950px;
       	}
       ```
   
 * This seems to affect the 1st row of content where the loop is. It is the property
   that the default theme already had in the style.css file just with my changes
   I used the css to center the main content to align with the header and changed
   some details of color.
 * In the secondrow.php I have a `<div id="secondrow">` this is as follows:
 *     ```
       #secondrow {
       	background-color: #003c7a;
       	background-image: url(images/bkg_tworow.jpg);
       	background-repeat: repeat-x;
       	height: 400px;
       }
       ```
   
 * The idea is to have this area be in contrast to the main content area by a repeated
   gradient image that spans from the left of the browser window to the right of
   it. The problem is that this repeated image seems to be inheriting some quality
   from the #page property and it is not going all the way across. I’m not very 
   good with css yet so thus far I’m unable to see what could be causing it (despite
   hours of trying). Is there something I’m overlooking or perhaps a way to force
   the repeated background to go all the way across with some nifty css trick? If
   someone could help I’d be very grateful.
 * If I need to provide more information please let me know
 * Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [rosemckay](https://wordpress.org/support/users/rosemckay/)
 * (@rosemckay)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/css-background-width/#post-1009259)
 * Hmmm it seems like the only solution I can find is to make the width of #secondrow
   <i>really</i> wide like maybe 3,000 pixels, center it and then disable the horizontal
   scroll bar. I don’t really want to have to do this because it will make accessibility
   a nightmare for users who might have a lower screen resolution or a special need.
 * Any suggestions for another solution?
 *  [t31os](https://wordpress.org/support/users/t31os/)
 * (@t31os)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/css-background-width/#post-1009270)
 * Can you link to the page?
 * Would be a whole lot easier to help if i can see the site in question… thanx ..
   😉
 * Repeating the image should be simple, it’s proberly just an inheritance issue.
 *  Thread Starter [rosemckay](https://wordpress.org/support/users/rosemckay/)
 * (@rosemckay)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/css-background-width/#post-1009285)
 * Here’s the template in progress [link](http://razzberrymedia.com/templates/)
 * Hopefully this’ll help. Another problem that has cropped up is that the secondrow.
   php doesn’t bump down with the main content, you’ll see when you look at the 
   page that it overlaps the sidebar info. If you have time and don’t mind maybe
   you could give me some pointers on this too?
 * Thanks for taking the time to help!!!
 *  [t31os](https://wordpress.org/support/users/t31os/)
 * (@t31os)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/css-background-width/#post-1009294)
 * I’d lose all the huge negative margins and positioning, i’m sure you’re making
   the positioning harder then it needs to be…
 * It’s hard to determine if the problem is the effect of one or a combination of
   many elements.
 * The best thing i can suggest is to take a look at some CSS templates that archieve
   the level of positioning you want and then take a look at the CSS used to produce
   the result…
 * Remember CSS is cascading, some definitions will cascade down onto elements inside
   defined elements. This is also handled slightly differently depending on the 
   browser.
 * Ideally you should only need a few floats and margins, and perhaps a container/
   wrapper DIV to position everything in the center with margins if required.
 * I’d personally start with the template in a single HTML page, with the images
   and text hard-coded into that page for testing, once the page and accompanying
   CSS behaves as you want, then chop it up and place it into a template on WordPress
   testing as you go…

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘CSS Background width’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [inherit](https://wordpress.org/support/topic-tag/inherit/)

 * 4 replies
 * 2 participants
 * Last reply from: [t31os](https://wordpress.org/support/users/t31os/)
 * Last activity: [17 years, 3 months ago](https://wordpress.org/support/topic/css-background-width/#post-1009294)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
