Title: CSS parsing problem
Last modified: August 19, 2016

---

# CSS parsing problem

 *  Resolved [Jonas Grumby](https://wordpress.org/support/users/ss_minnow/)
 * (@ss_minnow)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/css-parsing-problem/)
 * Hi everyone. I’m sure this is what we used to call a ID-10T error, but what I
   am trying to do is create a theme that has a white border around the entire thing,
   a header area across the top, and a sidebar and content area below that. What
   is happening is that the text starts inside the white border, but then breaks
   out of it and continues down the page instead of staying contained within the
   border. My code works fine as static HTML but not in WP.
 * Here is the simple code that I wrote into index.php to test this:
 *     ```
       <div id="container">
       	<div id="testheader">
       this is the header this is the header this is the header this is the header this is the header this is the header this is the header this is the header this is the header this is the header this is the header this is the header this is the header this is the header this is the header this is the header
       	</div>
   
       	<div id="wrapper">
       		<div id="content">this is the the content area this is the the content area this is the the content area this is the the content area this is the the content area this is the the content area this is the the content area this is the the content area this is the the content area this is the the content area this is the the content area this is the the content area this is the the content area this is the the content area </div>
       		<div id="sidebar">this is the sidebar this is the sidebar this is the sidebar this is the sidebar this is the sidebar this is the sidebar this is the sidebar this is the sidebar this is the sidebar </div>
       	</div>
   
       </div>
       ```
   
 * Here is the stylesheet info:
 *     ```
       body {
       	font-size: 62.5%; /* Resets 1em to 10px */
       	font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
       	background: #000000;
       	color: #FFFFFF;
       	}
   
       #container {
       	width: 900px;
       	background: #000000;
       	border-width: 4px;
       	border-color: #FFFFFF;
       	border-style: solid;
       	margin: auto;
       	}
       #wrapper {
       	padding: 10px;
       	font-size: 12px;
       	line-height: 20px;
       	}
   
       #content {
       	float: right;
       	width: 600px;
       	}
   
       #sidebar {
       	font: 1em 'Lucida Grande', Verdana, Arial, Sans-Serif;
       	float: left;
       	width: 210px;
       	}
       ```
   
 * Note that testheader is not defined in the stylesheet. I changed it from header
   to testheader so the header background graphic would not be called in.
 * Here is how it displays: [http://johnnasta.com/blog/?theme=VNF](http://johnnasta.com/blog/?theme=VNF)
 * I did originally try to code it all out with loop, sidebar, and header code but
   had the same results. I stripped all of that out and replaced it with dummy text
   to simplify the example and eliminate possible causes.
 * It seems like this should be simple. Can someone tell me what I’m doing wrong?
 * Thanks!

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

 *  Thread Starter [Jonas Grumby](https://wordpress.org/support/users/ss_minnow/)
 * (@ss_minnow)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/css-parsing-problem/#post-1392001)
 * p.s. I have tried adding `height: auto;` as well as `min-height: 100%;` to the
   container style but neither of those made any difference 🙁
 *  Thread Starter [Jonas Grumby](https://wordpress.org/support/users/ss_minnow/)
 * (@ss_minnow)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/css-parsing-problem/#post-1392005)
 * p.p.s. adding `display: inline-block;` to the container CSS fixed the problem
   of the floated elements breaking out of the container but now it’s no longer 
   centered. I guess I could wrap the whole thing in another div.
 * Other things that did not work:
    - [The clearfix example shown here](http://www.webtoolkit.info/css-clearfix.html)
      made the white border go away entirely and made the width go to 100%
    - Using `<div style="clear: all;"></div>` or `<br clear=all>` after the nested
      divs did nothing.
    - Adding float: none; or float: center; to the container style
 * As Paul McCartney once said “I’m getting closer, my salamander”.
 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/css-parsing-problem/#post-1392006)
 * there is no such thing as float center…
 * it’s usually done with margins… like margin:0 auto;
 *  Thread Starter [Jonas Grumby](https://wordpress.org/support/users/ss_minnow/)
 * (@ss_minnow)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/css-parsing-problem/#post-1392007)
 * Thanks [@rvoodoo](https://wordpress.org/support/users/rvoodoo/). Setting either
   the container or a new parent div to `margin:0 auto;` did not work. Wrapping 
   the whole thing in a new parent div with `text-align: center;` and then setting
   the container div to `text-align:left;` worked. It’s displaying the way I want
   it to now, and no errors reported from W3C Markup Validation.
 * `float: center;` was wishful thinking on my part.
 * I always appreciate your help.
 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/css-parsing-problem/#post-1392008)
 * yeah…float:center would be very nice!
 * glad you got things set up!
 *  Thread Starter [Jonas Grumby](https://wordpress.org/support/users/ss_minnow/)
 * (@ss_minnow)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/css-parsing-problem/#post-1392013)
 * Yeah, thanks. I found some [good info here](http://www.brainjar.com/css/positioning/default.asp)
   about inline boxes and other CSS elements.
 *  Thread Starter [Jonas Grumby](https://wordpress.org/support/users/ss_minnow/)
 * (@ss_minnow)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/css-parsing-problem/#post-1392016)
 * For anyone who doesn’t want to read the whole page, here is the key text:
 * “There are two basic types of boxes, block and inline. Block boxes are generated
   by elements such as P, DIV or TABLE. **Inline boxes are generated by tags** such
   as B, I or SPAN **and actual content like text and images**.”

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

The topic ‘CSS parsing problem’ is closed to new replies.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [html](https://wordpress.org/support/topic-tag/html/)
 * [Parsing](https://wordpress.org/support/topic-tag/parsing/)
 * [template](https://wordpress.org/support/topic-tag/template/)
 * [Themes](https://wordpress.org/support/topic-tag/themes/)

 * 7 replies
 * 2 participants
 * Last reply from: [Jonas Grumby](https://wordpress.org/support/users/ss_minnow/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/css-parsing-problem/#post-1392016)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
