Title: Full width with custom-page template (PHP,CSS)
Last modified: August 21, 2016

---

# Full width with custom-page template (PHP,CSS)

 *  [ChrisFo](https://wordpress.org/support/users/chrisfo/)
 * (@chrisfo)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/full-width-with-custom-page-template-phpcss/)
 * I’m struggling to insert a clean CSS style for forcing some special subpages 
   to present content with full screen width. I have added a custom template and
   activated it on the page and was trying to register a CSS for clean insertion
   in the header. As it was not possible to set it up I have now inserted a ugly
   inline CSS. Both the PHP and CSS code from custom-page-full-width.php:
 *     ```
       <?php
       /*
       Template Name: Custom Page Full Width
       */
       ?>
   
       <?php
       // Full Width Code
       // Register Style
       function full_width_styles() {
   
       	wp_register_style( 'full_width_container', get_template_directory_uri() . '/custom-page-full-width.css', false, '0.5', 'all' );
   
       }
       // Hook into the 'wp_enqueue_scripts' action
       add_action( 'wp_enqueue_scripts', 'full_width_styles' );
       ?>
   
       <?php do_action( '__before_main_wrapper' ); ##hook of the header with get_header ?>
       <style type="text/css" media="screen">
       /* full width page (custom template) */
       .container, .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container {
       	width: 96%;
       }
       .span9 {
       width: 100%;
       }
       </style>
   
       <div id="main-wrapper" ... (etc. -- standard code)
       ```
   

The topic ‘Full width with custom-page template (PHP,CSS)’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/customizr/4.4.24/screenshot.png)
 * Customizr
 * [Support Threads](https://wordpress.org/support/theme/customizr/)
 * [Active Topics](https://wordpress.org/support/theme/customizr/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/customizr/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/customizr/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [custom-template](https://wordpress.org/support/topic-tag/custom-template/)
 * [full-width](https://wordpress.org/support/topic-tag/full-width/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 0 replies
 * 1 participant
 * Last reply from: [ChrisFo](https://wordpress.org/support/users/chrisfo/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/full-width-with-custom-page-template-phpcss/)
 * Status: not resolved