Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I got it by putting together many different sources. Alex Coles' solution was closest right off the bat but the middle wasn't centered. It was much cleaner than my mess too. I started with the code from <a href="http://social.expression.microsoft.com/Forums/nl-NL/web/thread/f8abb1de-2223-47f3-8cc3-4d925f93d307" rel="nofollow noreferrer">this post</a>:</p> <pre><code>&lt;style type="text/css"&gt; .leftit { float: left; } .rightit { float: right; } .centerit { width: 30%; margin-right: auto; margin-left: auto; text-align: center; } .centerpage { width: 80%; margin-right: auto; margin-left: auto; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="centerpage"&gt; &lt;div class="leftit"&gt;Hello Left&lt;/div&gt; &lt;div class="rightit"&gt;Hello Right&lt;/div&gt; &lt;div class="centerit"&gt;Hello Middle&lt;/div&gt; &lt;/div&gt; </code></pre> <p>(<a href="http://jsfiddle.net/m4pZz/" rel="nofollow noreferrer">fiddle for above</a>)</p> <p>I took the elements Alex cleaned up which got me even closer to my goal, but the center color blocks were way too wide. From <a href="https://stackoverflow.com/questions/450903/make-css-div-width-equal-to-contents">this question</a> I learned about "max-width", which ended up being the final piece I needed...or so I thought.</p> <p>Edit: max-width doesn't work in IE7 quirks mode (which I have to support) so from <a href="http://dorward.me.uk/www/centre/#ie" rel="nofollow noreferrer">this page</a> I learned how to tweak my css to work in IE7 quirks mode, IE8, and FF.</p> <p>The final code (<a href="http://jsfiddle.net/Ky9xL/" rel="nofollow noreferrer">fiddle</a>):</p> <pre><code>.leftit { float: left; font-size: 0.8em; } .rightit { float: right; font-size: 0.8em; } .centerit { width:220px; margin-right: auto; margin-left: auto; font-size: 0.8em; } #headmiddle div { border: 1px solid #000; margin-bottom: 3px; } .centerpage { margin-right: auto; margin-left: auto; text-align: center; } strong { font-weight: bold; } .search { background: orange; } .active { background: #8ed200; } dt { float: left; font-weight: bold; } dd { margin-left: 4.5em; } &lt;div class="centerpage"&gt; &lt;div class="leftit"&gt;a little search form here&lt;/div&gt; &lt;div class="rightit"&gt; &lt;dl&gt; &lt;dt&gt;Legend:&lt;/dt&gt; &lt;dd&gt;Status numero uno&lt;/dd&gt; &lt;dd&gt;Status two&lt;/dd&gt; &lt;/dl&gt; &lt;/div&gt; &lt;div class="centerit" id="headmiddle"&gt; &lt;div class="active"&gt;&lt;strong&gt;Status:&lt;/strong&gt; Active&lt;/div&gt; &lt;div class="search"&gt;Search results displayed&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Thanks to all the great answers - I learned a lot from this question.</p> <p>Paul</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload