Title: modifying CSS for custom page template
Last modified: August 20, 2016

---

# modifying CSS for custom page template

 *  [maxpayne13](https://wordpress.org/support/users/maxpayne13/)
 * (@maxpayne13)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/modifying-css-for-custom-page-template/)
 * Hello everyone, I am having an issue with a page template. So here is the issue,
   I went ahead and created a new page template, renamed and removed the sidebar
   by deleting a bunch of atomic php lines.
 * Now the original default page template is retrieving the background from a picture.
   I went ahead and modified the picture, the original pic name was “bg-container”
   so I called this modified pic bg-container1. Now if I locate the #container tag
   in the CSS and change from bg-container to bg-container1 it works perfectly except
   it applies this to every page. So I went ahead and inserted this line at the 
   end of the css file
 * .page-template-nosidebar .container{overflow:hidden;width:980px;margin:30px auto
   0;background:url(images/bg-container1.png) repeat-y}
 * I did this with a previous page and it has worked fine but for some reason it
   doesn’t work with this one. What am I doing wrong, it seems the only way I can
   change this background image is to change the main image which changes all of
   them. Can anyone tell me how I can apply this modified image to my page template?

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

 *  [SiRa-wp](https://wordpress.org/support/users/sira-wp/)
 * (@sira-wp)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/modifying-css-for-custom-page-template/#post-2757872)
 * From what you have written it should be #container .page-template-nosidebar…
 * Depends on your ids and classes.
 * Best wishes
 *  Thread Starter [maxpayne13](https://wordpress.org/support/users/maxpayne13/)
 * (@maxpayne13)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/modifying-css-for-custom-page-template/#post-2757876)
 * #container .page-template-nosidebar{overflow:hidden;width:980px;margin:30px auto
   0;background:url(images/bg-container1.png) repeat-y}
 * this does not work, sorry :(.
 * this is my page right now
 * [http://216.172.171.18/~carranza/test6/?page_id=1209/](http://216.172.171.18/~carranza/test6/?page_id=1209/)
 *  Thread Starter [maxpayne13](https://wordpress.org/support/users/maxpayne13/)
 * (@maxpayne13)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/modifying-css-for-custom-page-template/#post-2757881)
 * basically I modified the entry content without any issues but I can;t seem to
   apply this container tag to a new template
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/modifying-css-for-custom-page-template/#post-2757889)
 * according to basic rules of css:
 * `.page-template-nosidebar1 #container {}`
 * please use a tool such as Firebug [http://getfirebug.com/](http://getfirebug.com/)
   or similar for these kind of formatting problems.
 * [http://www.w3schools.com/css/](http://www.w3schools.com/css/)
 *  Thread Starter [maxpayne13](https://wordpress.org/support/users/maxpayne13/)
 * (@maxpayne13)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/modifying-css-for-custom-page-template/#post-2758051)
 * Thanks alchymyth, that worked perfectly. I guess I need to brush up on my CSS
   skills.
 * One last question, I removed these lines from my page to remove the side bar,
   will this cause problems?
 * **<?php do_atomic( ‘before_content’ ); // Before content hook ?>**
 *  <div id=”content”>
 *  <?php do_atomic( ‘open_content’ ); // Open content hook ?>
 * and approx 5 lines down, this line
 *  **<div id=”post-<?php the_ID(); ?>” class=”<?php hybrid_entry_class(); ?>”>**

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

The topic ‘modifying CSS for custom page template’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [maxpayne13](https://wordpress.org/support/users/maxpayne13/)
 * Last activity: [13 years, 12 months ago](https://wordpress.org/support/topic/modifying-css-for-custom-page-template/#post-2758051)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
