Some CSS Layouts



Some CSS LayoutsNote: These are not responsive. For example, layout 2 uses 420 pixels for the two sidebars and margins, but the oriignal iPhone was only 320 pixels wide, and even today there are many phones which are only 720 pixels wide. See the chapter on Responsive Web Design for layouts which accommodate a range of screen sizes.Two Columns – A List Apart (ALA) style/* */ (Site no longer avaiable) /* Left content */#main {float:left;width:67%;background:#fff;border-right:2px solid #000;border-bottom:2px solid #000;margin-right:15px;padding-bottom:20px;} /* Right (narrower) content has navigation in whatever is left over */Three columns with middle one of variable width/* *//*Left content */#leftcontent {position: absolute;left:10px;top:50px;width:200px;background:#fff;border:1px solid #000;} /*Center content */#centercontent {background:#fff;margin-left: 199px;margin-right:199px;border:1px solid #000;voice-family: "\"}\"";voice-family: inherit;margin-left: 201px;margin-right:201px;}html>body #centercontent {margin-left: 201px;margin-right:201px;} /* Right content */#rightcontent {position: absolute;right:10px;top:50px;width:200px;background:#fff;border:1px solid #000;}3. Header, footer, and narrower of 2 columns on the left /* Created by Keith Donegan of Code- E-Mail: Keithdonegan@ You can do whatever you want with these layouts, but it would be greatly appreciated if you gave a link back to */* { padding: 0; margin: 0; }body { font-family: Arial, Helvetica, sans-serif; font-size: 13px;}#wrapper { margin: 0 auto; width: 922px;}#header { color: #333; width: 900px; float: left; padding: 10px; border: 1px solid #ccc; height: 100px; margin: 10px 0px 5px 0px; background: #BD9C8C;}#leftcolumn { color: #333; border: 1px solid #ccc; background: #E7DBD5; margin: 0px 5px 5px 0px; padding: 10px; height: 350px; width: 195px; float: left;}#rightcolumn { float: right; color: #333; border: 1px solid #ccc; background: #F2F2E6; margin: 0px 0px 5px 0px; padding: 10px; height: 350px; width: 678px; display: inline;}#footer { width: 900px; clear: both; color: #333; border: 1px solid #ccc; background: #BD9C8C; margin: 0px 0px 10px 0px; padding: 10px;}Three Fixed Columns<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ""><html><head><title>Layout 10</title><meta http-equiv="content-type" content="text/html; charset=iso-8859-1"><meta name="generator" content="HAPedit 3.1"><style type="text/css">html,body{margin:0;padding:0}body{font: 76% arial,sans-serif;text-align:center}p{margin:0 10px 10px}a{display:block;color: #981793;padding:10px}div#header h1{height:80px;line-height:80px;margin:0; padding-left:10px;background: #EEE;color: #79B30B}div#container{text-align:left}div#content p{line-height:1.4}div#navigation{background:#B9CAFF}div#extra{background:#FF8539}div#footer{background: #333;color: #FFF}div#footer p{margin:0;padding:5px 10px}div#container{width:700px;margin:0 auto}div#wrapper{float:left;width:100%}div#content{margin-right: 300px}div#navigation{float:left;width:150px;margin-left:-150px}div#extra{float:left;width:150px;margin-left:-300px}div#footer{clear:left;width:100%}</style></head><body><div id="container"><div id="header"><h1>Header</h1></div><div id="wrapper"><div id="content"><p><strong>1) Content here.</strong> column long long column very long fill fill fill long text text column text silly very make long very fill silly make make long make text fill very long text column silly silly very column long very column filler fill long make filler long silly very long silly silly silly long filler make column filler make silly long long fill very.</p><p>very make make fill silly long long filler column long make silly silly column filler fill fill very filler text fill filler column make fill make text very make make very fill fill long make very filler column very long very filler silly very make filler silly make make column column </p><p>fill long make long text very make long fill column make text very silly column filler silly text fill text filler filler filler make make make make text filler fill column filler make silly make text text fill make very filler column very </p><p>column text long column make silly long text filler silly very very very long filler fill very fill silly very make make filler text filler text make silly text text long fill fill make text fill long text very silly long long filler filler fill silly long make column make silly long column long make very </p></div></div><div id="navigation"><p><strong>2) Navigation here.</strong> long long fill filler very fill column column silly filler very filler fill fill filler text fill very silly fill text filler silly silly filler fill very make fill column text column very very column fill fill very silly column silly silly fill fill long filler </p></div><div id="extra"><p><strong>3) More stuff here.</strong> column long make silly silly filler silly very very very long column filler fill make column make silly column fill silly column long make silly filler column filler silly long long column fill silly column very </p></div><div id="footer"><p>Here it goes the footer</p></div></div></body></html>Three fixed columns from Max Designs at /* -----------------------Base styles------------------------*/body{margin: 0;padding: 0;color: #333;background-color: #eee;font: 1em/1.2 "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;}h1,h2,h3,h4,h5,h6{margin: 0 0 .5em;font-weight: 500;line-height: 1.1;}h1 { font-size: 2.25em; } /* 36px */h2 { font-size: 1.75em; } /* 28px */h3 { font-size: 1.375em; } /* 22px */h4 { font-size: 1.125em; } /* 18px */h5 { font-size: 1em; } /* 16px */h6 { font-size: .875em; } /* 14px */p{margin: 0 0 1.5em;line-height: 1.5;}blockquote{padding: 1em 2em;margin: 0 0 2em;border-left: 5px solid #eee;}hr{height: 0;margin-top: 1em;margin-bottom: 2em;border: 0;border-top: 1px solid #ddd;}table{background-color: transparent;border-spacing: 0;border-collapse: collapse;border-top: 1px solid #ddd;}th, td{padding: .5em 1em;vertical-align: top;text-align: left;border-bottom: 1px solid #ddd;}a:link { color: royalblue; }a:visited { color: purple; }a:focus { color: black; }a:hover { color: green; }a:active { color: red; }/* -----------------------Layout styles------------------------*/.container{max-width: 80em;margin: 0 auto;}.header{color: #fff;background: #999;padding: 1em 1.25em;}.header-heading { margin: 0; }.nav-bar{background: #000;padding: 0;}.content{overflow: hidden;padding: 1em 1.25em;background-color: #fff;}.col1,.col2,.col3{margin-bottom: 1em;}.footer{color: #fff;background: #000;padding: 1em 1.25em;}/* -----------------------Nav------------------------*/.nav{margin: 0;padding: 0;list-style: none;}.nav li{display: inline;margin: 0;}.nav a{display: block;padding: .7em 1.25em;color: #fff;text-decoration: none;border-bottom: 1px solid gray;}.nav a:link { color: white; }.nav a:visited { color: white; }.nav a:focus{color: black;background-color: white;}.nav a:hover{color: white;background-color: green;}.nav a:active{color: white;background-color: red;}/* -----------------------Single styles------------------------*/.img-responsive { max-width: 100%; }.btn{color: #fff !important;background-color: royalblue;border-color: #222;display: inline-block;padding: .5em 1em;margin-bottom: 0;font-weight: 400;line-height: 1.2;text-align: center;white-space: nowrap;vertical-align: middle;cursor: pointer;border: 1px solid transparent;border-radius: .2em;text-decoration: none;}.btn:hover{color: #fff !important;background-color: green;}.btn:focus{color: #fff !important;background-color: black;}.btn:active{color: #fff !important;background-color: red;}.table{width: 100%;max-width: 100%;margin-bottom: 20px;}.list-unstyled{padding-left: 0;list-style: none;}.list-inline{padding-left: 0;margin-left: -5px;list-style: none;}.list-inline > li{display: inline-block;padding-right: 5px;padding-left: 5px;}/* -----------------------Wide styles------------------------*/@media (min-width: 60em){.header { padding: 1.5em 2em; }.nav-bar { padding: 1em 2em; }.content { padding: 2em 2em; }.col1{float: left;width: 48%;margin-right: 4%;}.col2{float: left;width: 22%;margin-right: 4%;}.col3{float: left;width: 22%;}.footer { padding: 2em 3em; }.nav li{display: inline;margin: 0 1em 0 0;}.nav a{display: inline;padding: 0;border-bottom: 0;}}3 column layout - Layout 1 from html,body{margin:0;padding:0}body {font: 76% arial,sans-serif; text-align:center}p {margin:0 10px 10px}a {padding:5px; text-decoration:none; color:#000000;}div#header {background-color:#F3F2ED;}div#header h1 {height:80px; line-height:80px; margin:0; padding-left:10px;}div#container {text-align:left}div#content p {line-height:1.4}div#navigation {background:#F6F0E0;}div#navigation ul {margin:15px 0; padding:0; list-style-type:none;}div#navigation li {margin-bottom:5px;}div#extra {background:#CCC8B3;}div#footer {background:#BFBD93;}div#footer p {margin:0; padding:5px 10px}div#container {width:700px; margin:0 auto}div#wrapper {float:left; width:100%}div#content {margin: 0 150px}div#navigation {float:left;width:150px; margin-left:-700px}div#extra {float:left;width:150px; margin-left:-150px}div#footer {clear:left; width:100%}Layout #8 from html,body{margin:0;padding:0}body{font: 76% arial,sans-serif;text-align:center}p{margin:0 10px 10px}a{padding:5px; text-decoration:none; color:#000000;}div#header{background-color:#F3F2ED;}div#header h1{height:80px;line-height:80px;margin:0;padding-left:10px;}div#container{text-align:left}div#content p{line-height:1.4}div#navigation{background:#F6F0E0;}div#navigation ul{margin:15px 0; padding:0; list-style-type:none;}div#navigation li{margin-bottom:5px;}div#extra{background:#CCC8B3;}div#footer{background:#BFBD93;}div#footer p{margin:0;padding:5px 10px}div#container{width:700px;margin:0 auto}div#content{float:right;width:500px}div#navigation{float:left;width:200px}div#extra{float:left;clear:left;width:200px}div#footer{clear:both;width:100%}.Layout #12 from html,body{margin:0;padding:0}body{font: 76% arial,sans-serif;text-align:center}p{margin:0 10px 10px}a{padding:5px; text-decoration:none; color:#000000;}div#header{background-color:#F3F2ED;}div#header h1{height:80px;line-height:80px;margin:0;padding-left:10px;}div#container{text-align:left}div#content p{line-height:1.4}div#navigation{background:#F6F0E0;}div#navigation ul{margin:15px 0; padding:0; list-style-type:none;}div#navigation li{margin-bottom:5px;}div#extra{background:#CCC8B3;}div#footer{background:#BFBD93;}div#footer p{margin:0;padding:5px 10px}div#container{width:700px;margin:0 auto}div#content{float:right;width:500px}div#navigation{float:left;width:200px}div#extra{clear:both;width:100%}Layout #18 from /*Copyright (c) 2007, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:: 2.2.2*//* for all templates and grids */body{text-align:center;}#ft{clear:both;}/**//* 750 centered, and backward compatibility */ #doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 {margin:auto;text-align:left;width:57.69em;*width:56.3em;min-width:750px;}/* 950 centered */ #doc2 {width:73.074em;*width:71.313em;min-width:950px;}/* 100% with 10px viewport side matting */ #doc3 {margin:auto 10px; /* not for structure, but so content doesn't bleed to edge */width:auto;}/* below required for all fluid grids; adjust widths and margins above accordingly *//* to preserve source-order independence for Gecko */.yui-b{position:relative;}.yui-b{_position:static;} /* for IE < 7 */#yui-main .yui-b{position:static;} #yui-main {width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;/* IE: preserve layout at narrow widths */}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;/* IE: preserve layout at narrow widths */}.yui-t1 .yui-b {float:left; width:12.3207em;*width:12.0106em;}.yui-t1 #yui-main .yui-b{ margin-left:13.3207em;*margin-left:13.0106em;}.yui-t2 .yui-b {float:left; width:13.8456em;*width:13.512em;}.yui-t2 #yui-main .yui-b { margin-left:14.8456em;*margin-left:14.512em;}.yui-t3 .yui-b {float:left; width:23.0759em;*width:22.52em;}.yui-t3 #yui-main .yui-b { margin-left:24.0759em;*margin-left:23.52em;}.yui-t4 .yui-b {float:right; width:13.8456em;*width:13.512em;}.yui-t4 #yui-main .yui-b { margin-right:14.8456em;*margin-right:14.512em;}.yui-t5 .yui-b {float:right; width:18.4608em;*width:18.016em;}.yui-t5 #yui-main .yui-b { margin-right:19.4608em;*margin-right:19.016em;}.yui-t6 .yui-b {float:right; width:23.0759em;*width:22.52em;}.yui-t6 #yui-main .yui-b { margin-right:24.0759em;*margin-right:23.52em;}.yui-t7 #yui-main .yui-b {display:block;margin:0 0 1em 0;}#yui-main .yui-b {float:none;width:auto;}/* GRIDS (not TEMPLATES) */.yui-g .yui-u, .yui-g .yui-g, .yui-gc .yui-u,.yui-gc .yui-g .yui-u,.yui-ge .yui-u, .yui-gf .yui-u{float:right;display:inline;}.yui-g div.first, .yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first, .yui-ge div.first, .yui-gf div.first{float:left;}.yui-g .yui-u, .yui-g .yui-g{width:49.1%;}.yui-g .yui-g .yui-u,.yui-gc .yui-g .yui-u {width:48.1%;}.yui-gb .yui-u, .yui-gc .yui-u, .yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}.yui-gb div.first, .yui-gc div.first, .yui-gd div.first{margin-left:0;}.yui-gc div.first, .yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge .yui-u{width:24%;}.yui-ge div.first, .yui-gf .yui-u{width:74.2%;}.yui-gf div.first{width:24%;}.yui-ge div.first{width:74.2%;}#bd:after,.yui-g:after, .yui-gb:after, .yui-gc:after, .yui-gd:after, .yui-ge:after, .yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g, .yui-gb, .yui-gc, .yui-gd, .yui-ge, .yui-gf{zoom:1;}/* Basic Element Formatting */#header{height:100px;background-color:#F3F2ED;margin:0;padding:0;}#header h1{font-size:1em;margin:0;padding:10px;}#header h1 a{color:#000000;background-color:#F3F2ED;}.content{height:300px;background:#CCC8B3;border-top:#FFFFFF 2px solid;margin:0;padding:0;}#secondary{height:300px;background:#F6F0E0;border-top:#FFFFFF 2px solid;margin:0;padding:0;}#secondaryFull{height:50px;background-color:#CFB59F;border-top:#FFFFFF 2px solid;margin:0;padding:0;}#footer{height:50px;background:#BFBD93;border-top:#FFFFFF 2px solid;margin:0;padding:0;}Layout 218 from {margin:0;padding:0}body{font: 76% arial,sans-serif;text-align:center}p{margin:0 10px 10px}a{padding:5px; text-decoration:none; color:#000000;}div#header{background-color:#F3F2ED;}div#header h1{height:80px;line-height:80px;margin:0;padding-left:10px;}div#container{text-align:left}div#content p{line-height:1.4}div#navigation{background:#F6F0E0;}div#navigation ul{margin:15px 0; padding:0; list-style-type:none;}div#navigation li{margin-bottom:5px;}div#extra{background:#CCC8B3;}div#footer{background:#BFBD93;}div#footer p{margin:0;padding:5px 10px}div#container{width:700px;margin:0 auto}div#content{float:right;width:500px}div#navigation{float:left;width:200px}div#extra{clear:both;width:100%} ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download