Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is an <a href="http://jsfiddle.net/DSKVR/nGjpz/5/" rel="nofollow noreferrer">example</a> of how I would model the html. </p> <p><em>Notes</em></p> <ul> <li>Tableless.</li> <li>I would make the <strong>tab action</strong> an <code>anchor</code> [<code>&lt;a&gt;</code>] for more flexible styling, I did not demonstrate this in an attempt to prevent bloated CSS in example.</li> <li>I would suggest looking into a CSS framework such as <a href="http://foundation.zurb.com/" rel="nofollow noreferrer">Foundation</a>, <a href="http://twitter.github.io/bootstrap/" rel="nofollow noreferrer">Bootstrap</a>, <a href="http://gumbyframework.com/" rel="nofollow noreferrer">Gumby</a>, <a href="http://960.gs" rel="nofollow noreferrer">960 Grid System</a> or <a href="http://blueprintcss.org" rel="nofollow noreferrer">Blueprint CSS Framework</a>. <strike>They are not especially necessary in this scenario, but useful none-the-less.</strike> Frameworks are highly suggested to achieve graceful responsive layouts. Here's a <a href="https://stackoverflow.com/questions/11277978/which-framework-is-best-for-starting-with-responsive-web-design">post on the subject</a></li> <li>The <code>#page &gt; #content</code> structure may be redundant in this specific example. However, I included it because this is correct if you would like to include a <code>#sidebar</code> as a sibling to <code>#content</code>, allowing for the styling of the wrapper [<code>#page</code>] </li> <li>IMHO the example exemplifies proper usage of IDs and Classes and element hierarchy that is conducive to very flexible styling, RE: <a href="http://www.csszengarden.com/" rel="nofollow noreferrer">CSS Zen Garden</a></li> </ul> <hr> <pre><code>&lt;div class="wrapper"&gt; &lt;div id="header"&gt; &lt;h1&gt;Header&lt;/h1&gt; &lt;/div&gt; &lt;div id="nav"&gt; &lt;a href="#"&gt;Link 1&lt;/a&gt; &lt;a href="#"&gt;Link 2&lt;/a&gt; &lt;a href="#"&gt;Link 3&lt;/a&gt; &lt;/div&gt; &lt;div id="page"&gt; &lt;div id="content"&gt; &lt;div class="section" id="section-1"&gt; &lt;div class="tabs left"&gt; &lt;ul&gt; &lt;li&gt;Tab 1&lt;/li&gt; &lt;li&gt;Tab 2&lt;/li&gt; &lt;li&gt;Tab 3&lt;/li&gt; &lt;/ul&gt; &lt;div class="tab"&gt; Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. &lt;/div&gt; &lt;div class="tab"&gt; Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. &lt;/div&gt; &lt;div class="tab"&gt; Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. &lt;/div&gt; &lt;/div&gt; &lt;div class="sub-sections right"&gt; &lt;div class="sub-section"&gt; A section &lt;/div&gt; &lt;div class="sub-section"&gt; And another &lt;/div&gt; &lt;div class="sub-section"&gt; just for kicks &lt;/div&gt; &lt;/div&gt; &lt;div class="clearfix"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="section" id="section-2"&gt; &lt;div class="left"&gt; Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. &lt;/div&gt; &lt;div class="sub-sections right"&gt; &lt;div class="sub-section"&gt; A section &lt;/div&gt; &lt;div class="sub-section"&gt; And another &lt;/div&gt; &lt;div class="sub-section"&gt; just for kicks &lt;/div&gt; &lt;/div&gt; &lt;div class="clearfix"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <hr> <pre><code>.wrapper { width:90%; margin:0 auto; } .wrapper &gt; div { width:auto; margin-bottom:10px; border-bottom:1px solid #f0f0f0; } .section { min-height:200px; margin-bottom:10px; border:1px solid #f0f0f0; border-bottom-width:5px; } .section &gt; .left { width:80%; float:left; } .section &gt; .right { width:20%; float:right; } .tabs ul li { display:inline; background:#f0f0f0; margin-right:5px; } .tabs .tab { display:none; } .tabs .tab:nth-child(0n+1) { display:block; } .section .sub-sections .sub-section { margin-bottom:5px; background:#f0f0f0; } /* Independently Style Sections Here */ #section-1 {border-color:red;} #section-2 {border-color:green} /* Clear Floated Elements ----------------------------------------------------------------------------------------------------*/ /* http://sonspring.com/journal/clearing-floats */ .clearfix { clear: both; display: block; overflow: hidden; visibility: hidden; width: 0; height: 0; } /* http://perishablepress.com/press/2008/02/05/lessons-learned-concerning-the-clearfix-css-hack */ .clearfix:after { clear: both; content: ' '; display: block; font-size: 0; line-height: 0; visibility: hidden; width: 0; height: 0; } .clearfix { display: inline-block; } * html .clearfix { height: 1%; } .clearfix { display: block; } </code></pre> <ul> <li>Extra Credit: Use CSS media queries to make the layout responsive.</li> <li>Extra Extra Credit: Translate entire layout to HTML5</li> </ul>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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