Advertisement
Palareas

free-3col-liquid-css-with-centered-menu.html

Jun 22nd, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 11.17 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB">
  3. <head>
  4.     <title>Top 3 Column Liquid Layout: No CSS hacks. SEO friendly. iPhone ready.</title>
  5.     <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
  6.     <meta name="description" content="Top 3 Column Liquid Layout with centered Menue" />
  7.     <meta name="keywords" content="The Perfect 3 Column Liquid Layout and Menu: No CSS hacks. SEO friendly. iPhone ready." />
  8.     <meta name="robots" content="index, follow" />
  9.     <style media="screen" type="text/css">
  10.     /* <!-- */
  11.  
  12. /* You can download the two images here: http://i.imgur.com/5rWvreA.gif  and  http://i.imgur.com/cLpNTx9.gif */
  13.  
  14.     /* General styles */
  15.     body {
  16.         margin:0;
  17.         padding:0;
  18.         border:0;           /* This removes the border around the view port in old versions of IE */
  19.         width:100%;
  20.         background:#111111;
  21.         min-width:600px;        /* Minimum width of layout - remove line if not required */
  22.                         /* The min-width property does not work in old versions of Internet Explorer */
  23.         font-size:90%;
  24.         color: #fff;
  25.     }
  26.     a {
  27.         color:#ddd;
  28.     }
  29.     a:hover {
  30.         color:#dddddd;
  31.         background:#111111;
  32.         text-decoration:none;
  33.     }
  34.     h1, h2, h3 {
  35.         color: #777;
  36.         margin:.8em 0 .2em 0;
  37.         padding:0;
  38.         clear:both;
  39.     }
  40.     p {
  41.         margin:.4em 0 .8em 0;
  42.         padding:0;
  43.     }
  44.     img {
  45.         margin:10px 0 5px;
  46.     }
  47.     #ads {
  48.         width:100%;
  49.         padding:20px 0;
  50.     }
  51.     #ads #mjt {
  52.         float:left;
  53.         margin-bottom:20px;
  54.     }
  55.     #ads .adhere {
  56.         margin:0 10px 10px 0;
  57.     }
  58.     #ads img {
  59.         display:block;
  60.         margin:0;
  61.     }
  62.    
  63.     /* download link */
  64.     .download {
  65.         clear:both;
  66.         float:left;
  67.         padding-top:10px;
  68.     }
  69.     .download a {
  70.         padding:.3em .5em !important;
  71.         margin-right:10px;
  72.         background:#222222;
  73.         text-decoration:none;
  74.         color:#dddddd;
  75.         font-weight:bold;
  76.         font-size:1.5em;
  77.         -moz-border-radius:.3em;
  78.         -webkit-border-radius:.3em;
  79.         border-radius:.3em;
  80.         line-height:2.5em;
  81.         -moz-box-shadow: 1px  1px 2px #000;
  82.         -webkit-box-shadow: 1px 1px 2px #000;
  83.         box-shadow: 1px 1px 2px #000;
  84.     }
  85.     .download a:hover {
  86.         background:#5f534f;
  87.         text-shadow: 2px 2px 2px #000;
  88.     }
  89.  
  90.     /* TallTabs Black Menue styles */
  91.     #talltabs-black {
  92.         clear:left;
  93.         float:left;
  94.         padding:0;
  95.         border-top:6px solid #333;
  96.         width:100%;
  97.         overflow:hidden;
  98.         font-family:Georgia, serif;
  99.     }
  100.     #talltabs-black ul {
  101.         float:left;
  102.         margin:0;
  103.         padding:0;
  104.         list-style:none;
  105.         position:relative;
  106.         left:50%;
  107.         text-align:center;
  108.     }
  109.     #talltabs-black ul li {
  110.         display:block;
  111.         float:left;
  112.         list-style:none;
  113.         margin:0;
  114.         padding:0;
  115.         position:relative;
  116.         right:50%;
  117.     }
  118.     #talltabs-black ul li a {
  119.         display:block;
  120.         float:left;
  121.         margin:0 1px 0 0;
  122.         padding:30px 10px 6px 10px;
  123.         background:#222;
  124.         text-decoration:none;
  125.         color:#dddddd;
  126.     }
  127.     #talltabs-black ul li a:hover {
  128.         padding:35px 10px 6px 10px;
  129.     }
  130.     #talltabs-black ul li.active a,
  131.     #talltabs-black ul li.active a:hover {
  132.         padding:40px 10px 6px 10px;
  133.         background:#333;
  134.     }
  135.     /* column container */
  136.     .colmask {
  137.         position:relative;  /* This fixes the IE7 overflow hidden bug */
  138.         clear:both;
  139.         float:left;
  140.         width:100%;         /* width of whole page */
  141.         overflow:hidden;        /* This chops off any overhanging divs */
  142.     }
  143.     /* common column settings */
  144.     .colright,
  145.     .colmid,
  146.     .colleft {
  147.         float:left;
  148.         width:100%;         /* width of page */
  149.         position:relative;
  150.     }
  151.     .col1,
  152.     .col2,
  153.     .col3 {
  154.         float:left;
  155.         position:relative;
  156.         padding:0 0 1em 0;  /* no left and right padding on columns, we just make them narrower instead
  157.                         only padding top and bottom is included here, make it whatever value you need */
  158.         overflow:hidden;
  159.     }
  160.     /* 3 Column settings */
  161.     .threecol {
  162.         background:#222222;     /* right column background colour */
  163.     }
  164.     .threecol .colmid {
  165.         right:25%;          /* width of the right column */
  166.         background:#111111;     /* center column background colour */
  167.     }
  168.     .threecol .colleft {
  169.         right:50%;          /* width of the middle column */
  170.         background:#222222; /* left column background colour */
  171.     }
  172.     .threecol .col1 {
  173.         width:46%;          /* width of center column content (column width minus padding on either side) */
  174.         left:102%;          /* 100% plus left padding of center column */
  175.     }
  176.     .threecol .col2 {
  177.         width:21%;          /* Width of left column content (column width minus padding on either side) */
  178.         left:31%;           /* width of (right column) plus (center column left and right padding) plus (left column left padding) */
  179.     }
  180.     .threecol .col3 {
  181.         width:21%;          /* Width of right column content (column width minus padding on either side) */
  182.         left:85%;           /* Please make note of the brackets here:
  183.                         (100% - left column width) plus (center column left and right padding) plus (left column left and right padding) plus (right column left padding) */
  184.     }
  185.     /* Footer styles */
  186.     #footer {
  187.         clear:both;
  188.         float:left;
  189.         width:100%;
  190.         border-top:1px solid #333;
  191.     }
  192.     #footer p {
  193.         padding:10px;
  194.         margin:0;
  195.     }
  196.     /* --> */
  197.     </style>
  198. </head>
  199. <body>
  200.  
  201.     <h1>Top 3 Column Liquid Layout with centered Menue</h1>
  202. <div id="talltabs-black">
  203.     <ul>
  204.         <li class="first"><a href="#">Menue Link <span>1</span></a></li>
  205.         <li class="active"><a href="#">Menue Link <span>2</span></a></li>
  206.         <li><a href="#">Menue Link <span>3</span></a></li>
  207.         <li><a href="#">Menue Link <span>4</span></a></li>
  208.         <li><a href="#">Menue Link <span>5</span></a></li>
  209.         <li class="last"><a href="#">Menue Link <span>6</span></a></li>
  210.     </ul>
  211. </div>
  212. <div class="colmask threecol">
  213.     <div class="colmid">
  214.         <div class="colleft">
  215.             <div class="col1">
  216.                 <!-- Column 1 start -->
  217.                 <h2>Percentage dimensions of the layout</h2>
  218.                 <img src="images/perfect-3-column-dimensions.gif" width="500" height="529" alt="Three column layout dimensions" />
  219.                 <p>All the dimensions are in percentage widths so the layout adjusts to any screen resolution. Vertical dimensions are not set so they stretch to the height of the content.</p>
  220.                 <h3>Maximum column content widths</h3>
  221.                 <p>To prevent wide content (like long URLs) from destroying the layout (long content can make the page scroll horizontally) the column content divs are set to overflow:hidden. This chops off any content that is wider than the div. Because of this, it's important to know the maximum widths allowable at common screen resolutions. For example, if you choose 800 x 600 pixels as your minimum compatible resolution what is the widest image that can be safely added to each column before it gets chopped off? Here are the figures:</p>
  222.                 <dl>
  223.                     <dt><strong>800 x 600</strong></dt>
  224.                     <dd>Left &amp; right columns: 162 pixels</dd>
  225.                     <dd>Center page: 357 pixels</dd>
  226.                     <dt><strong>1024 x 768</strong></dt>
  227.                     <dd>Left &amp; right columns: 210 pixels</dd>
  228.                     <dd>Center page: 459 pixels</dd>
  229.                 </dl>
  230.                 <h2>The nested div structure</h2>
  231.                 <p>I've coloured each div in the image so it's easy to see:</p>
  232.                 <img src="images/perfect-3-column-div-structure.gif" width="500" height="529" alt="Three column layout nested div structure" />
  233.                 <p>The header, colmask and footer divs are 100% wide and stacked vertically one after the other. Colmid is inside colmask and colleft is inside colmid. The three column content divs (col1, col2 &amp; col3) are inside colleft. Notice that the main content column (col1) comes before the other columns.</p>
  234.                 <!-- Column 1 end -->
  235.             </div>
  236.             <div class="col2">
  237.                 <!-- Column 2 start -->
  238.                 <h2>No CSS hacks</h2>
  239.                 <p>The CSS used for this layout is 100% valid and hack free. To overcome Internet Explorer's broken box model, no horizontal padding or margins are used in conjunction with a width. Instead, this design uses percentage widths and clever relative positioning.</p>
  240.                 <h2>SEO friendly ordering</h2>
  241.                 <p>The higher up content is in your page code, the more important it is considered by search engine algorithms . To make your website as optimised as possible, your main page content must come before the side columns. This layout does exactly that: The center page comes first, then the left column and finally the right column (see the nested div structure diagram for more info). The columns can also be configured to any other order if required.</p>
  242.                 <h2>Full length column background colours</h2>
  243.                 <p>In this layout the background colours of each column will always stretch to the length of the longest column. This feature was traditionally only available with table based layouts but now with a little CSS trickery we can do exactly the same with divs. Say goodbye to annoying short columns!</p>
  244.                 <h2>No Images</h2>
  245.                 <p>This layout requires no images. Many CSS website designs need images to colour in the column backgrounds but that is not necessary with this design. Why waste bandwidth and precious HTTP requests when you can do everything in pure CSS and XHTML?</p>
  246.                 <h2>No JavaScript</h2>
  247.                 <p>JavaScript is not required. Some website layouts rely on JavaScript hacks to resize divs and force elements into place but you won't see any of that nonsense here. The JavaScript at the bottom of this page is just my Google Analytics tracking code, you can remove this when you use the layout.</p>
  248.                 <h2>Resizable text compatible</h2>
  249.                 <p>This layout is fully compatible with resizable text. Resizable text is important for web accessibility. People who are vision impaired can make the text larger so it's easier for them to read. It is becoming increasingly more important to make your website resizable text compatible because people are expecting higher levels of web accessibility. Apple have made resizing the text on a website simple with the pinch gesture on their multi-touch trackpad. Is your website text-resizing compatible?</p>
  250.                 <h2>No Quirks Mode</h2>
  251.                 <p>This liquid layout does not require the XML declaration for it to display correctly in older versions of Internet Explorer. This version works without it and is thus never in quirks mode.</p>
  252.                 <h2>No IE Conditional Comments</h2>
  253.                 <p>Only one stylesheet is used with this layout This means that IE conditional comments are not needed to set extra CSS rules for older versions of Internet Explorer.</p>
  254.                 <!-- Column 2 end -->
  255.             </div>
  256.             <div class="col3">
  257.                 <!-- Column 3 start -->
  258.                 <h2>Browser Compatibility</h2>
  259.                 <p>This 3 column liquid Layout has been tested on the following browsers:</p>
  260.                 <h3>iPhone &amp; iPod Touch</h3>
  261.                 <ul>
  262.                     <li>Safari</li>
  263.                 </ul>
  264.                 <h3>Mac</h3>
  265.                 <ul>
  266.                     <li>Safari</li>
  267.                     <li>Firefox</li>
  268.                     <li>Opera 9.25</li>
  269.                     <li>Netscape 9.0.0.5 &amp; 7.1</li>
  270.                 </ul>
  271.                 <h3>Windows</h3>
  272.                 <ul>
  273.                     <li>Firefox 1.5, 2 &amp; 3</li>
  274.                     <li>Safari</li>
  275.                     <li>Opera 8.1 &amp; 9</li>
  276.                     <li>Google Chrome</li>
  277.                     <li>Explorer 5.5, 6 &amp; 7</li>
  278.                     <li>Netscape 8</li>
  279.                 </ul>
  280.                 <h2>Valid XHTML strict markup</h2>
  281.                 <p>The HTML in this layout validates as XHTML 1.0 strict.</p>
  282.                 <p>This layout is FREE for all!</p>
  283.  
  284.                 <!-- Column 3 end -->
  285.             </div>
  286.         </div>
  287.     </div>
  288. </div>
  289. <div id="footer">
  290.     <p>You can download the two images here: <a href="http://i.imgur.com/5rWvreA.gif">download img 1</a>  and <a href="http://i.imgur.com/cLpNTx9.gif">download img 2</a></p>
  291. </div>
  292.  
  293. </body>
  294. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement