prisskreative
8/22/2014 - 1:45 PM

CSS Layouts

CSS Layouts

<!DOCTYPE html>
<html>
<head>
	<title>Floats mobile first</title>
	<meta name="viewport" content="width=device-width">
	<link rel="stylesheet" href="css/normalize.css">
	<link rel="stylesheet" href="css/style.css">
	<style>
	/* Page Styles
================================ */

* {
	-moz-box-sizing: border-box;
	box-sizing: border-box;
}
body {
	font: normal 1.1em/1.5 sans-serif;
	color: #222;
	background-color: #edeff0;
}

/* Layout Element Colors
================================ */

.main-header       { background-color: #384047; }
.main-logo a       { background-color: #5fcf80; }
.main-nav a        { background-color: #3f8abf; }
.primary-content   { background-color: #caebf6; }
.secondary-content { background-color: #bfe3d0; }
.main-footer       { background-color: #b7c0c7; }

/* Header, Banner and Footer Layout
================================ */

.main-header {
	padding: 15px;
}
.main-logo {
	margin-top: 0;
	margin-bottom: 0;
}
.main-nav li {
	margin-top: 15px;
}
.main-logo a, 
.main-nav a {
	display: block;
	color: white;
	text-decoration: none;
	text-align: center;
	padding: 5px 15px;
	border-radius: 5px;
}
.main-footer {
	text-align: center;
	padding-top: 5px;
	padding-bottom: 5px;
}

/* Column Layout
================================ */

.col {
	padding: 20px;
}
.extra-content,
.main-banner {
	display: none;
}

/* Imagery
================================ */

.feat-img {
	width: 100%;
	margin-top: 10px;
	margin-bottom: 10px;
	border: solid 1px;
	padding: 5px;
}

/* Media Queries
================================ */

@media (min-width: 769px) {

	/* Header and Banner
	================================ */

	.main-logo,
	.main-nav li {
		float: left;
	}
	.main-logo {
		margin-right: 50px;
	}
	.main-nav li {
		margin-left: 15px;
	}
	.main-banner {
		background: #dfe2e4;
		text-align: center;
		padding: 35px 15px;
	}

	/* Column Layout
	================================ */

	.col {
		float: left;
		width: 30%;
	}
	.primary-content {
		width: 40%;
	}
	.col:last-child {
		float: right;
	}
	.extra-content,
	.main-banner {
		display: block; /* Unhide from mobile view */
	}

	/* Float Clearfix
	================================ */

	.group:after {
	  content: " ";
	  display: table;
	  clear: both;
	}

	/* Imagery
	================================ */

	.feat-img {
		width: 50%;
		float: left;
		margin-right: 25px;
	}

}


</style>
</head>
<body>
	<div class="main-wrapper">
		<header class="main-header group">
			<h1 class="main-logo"><a href="#">Logo</a></h1>
			<ul class="main-nav">
				<li><a href="#">Link 1</a></li>
				<li><a href="#">Link 2</a></li>
				<li><a href="#">Link 3</a></li>
				<li><a href="#">Link 4</a></li>
			</ul>
		</header>
		<div class="main-banner">
			<h1>This is the Main Banner Heading</h1>
			<p>Andouille pork chop pancetta drumstick ground round beef ribs swine brisket ham.</p>
		</div>
		<div class="content-row group">
			<div class="extra-content col">
				<h3>Extra Content</h3>
				<p>Filet mignon turkey flank doner strip steak. Frankfurter ham hock turkey, venison sirloin pig chuck shank capicola hamburger doner spare ribs boudin.</p>
				<hr>
				<p> Drumstick bresaola meatloaf ham hock salami tri-tip landjaeger beef filet mignon biltong boudin turkey.</p>
			</div>
			<div class="primary-content col">
				<h2>Primary Content</h2>
				<img class="feat-img" src="http://lorempixel.com/400/300">
				<p>Bacon ipsum dolor sit amet chicken pork ground round brisket corned beef ball tip shank tail salami filet mignon ham hock pork belly venison shankle. Pig kielbasa drumstick sausage pork chop boudin. Chicken t-bone salami pork chop, beef ribs kevin ham tri-tip beef venison biltong brisket.</p>
				<p>Venison strip steak meatball chicken, brisket prosciutto sirloin. Capicola drumstick brisket tri-tip salami. Chicken beef jerky, tail turkey prosciutto cow ham sirloin boudin tenderloin. Meatloaf tri-tip turducken brisket andouille, pork belly corned beef fatback hamburger.</p>
			</div>
			<div class="secondary-content col">
				<h3>Secondary Content</h3>
				<p>Strip steak tenderloin kevin swine meatloaf capicola, doner beef turducken pancetta corned beef pork loin shoulder.</p>
				<hr>
				<p>Pork filet mignon leberkas, tail swine venison pancetta turkey shoulder brisket chalkers likes hamburgers.</p>
			</div>
		</div>
		<footer class="main-footer">
			<p>&copy;2014 Example Layout</p>
		</footer>
	</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
	<title>Display Modes</title>
	<meta name="viewport" content="width=device-width">
	<style>
	  /* Page Styles
================================ */

* {
	-moz-box-sizing: border-box;
	box-sizing: border-box;
}
body {
	font: normal 1.1em/1.5 sans-serif;
	color: #222;
	background-color: #edeff0;
}
html,
body,
.main-wrapper,
.col {
	height: 100%;
}
/*.main-wrapper {
	width: 90%;
	margin: auto;
}*/

/* Layout Element Colors
================================ */

.main-header       { background-color: #384047; }
.main-logo         { background-color: #5fcf80; }
.main-nav li       { background-color: #3f8abf; }
.primary-content   { background-color: #caebf6; }
.secondary-content { background-color: #bfe3d0; }
.main-footer       { background-color: #b7c0c7; }

/* Header, Banner and Footer Layout
================================ */

.main-header {
	padding: 20px;
	display: table;
	width: 100%;
	min-height: 120px;
}
.main-banner {
	background: #ebedee;
	text-align: center;
	padding: 35px 15px;
}
.main-logo,
.main-nav,
.main-nav li {
	display: inline-block;
}
.main-logo,
.main-nav {
	display: table-cell;
	vertical-align: middle;
}
.main-logo {
	width: 120px;
}
.main-nav {
	padding-left: 50px;
}
.main-logo,
.main-nav li {
	border-radius: 5px;
}
.main-nav li {
	margin-right: 10px;
}
.main-logo a, 
.main-nav a {
	color: white;
	text-decoration: none;
	display: block;
	text-align: center;
	padding: 10px 20px;
}
.main-footer {
	text-align: center;
	padding: 10px;
}

/* Column Layout
================================ */

.col {
	display: inline-block;
	padding: 20px;
	margin-right: -5px;
	vertical-align: top;
}
.primary-content {
	width: 60%;
}
.secondary-content {
	width: 40%;
}

/* Media Queries
================================ */

@media (max-width: 768px) {
	.main-logo,
	.main-nav, 
	.main-nav li,
	.col {
       display: block;
       width: initial;
       height: initial;
	   margin: initial;
	}
	.main-nav {
		padding-left: initial;
	}
	.main-nav li {
	   margin-top: 15px;
	}
	.main-banner {
		display: none;
	}
}
	</style>
</head>
<body>
	<div class="main-wrapper">	
		<header class="main-header">
			<h1 class="main-logo"><a href="#">Logo</a></h1>
			<ul class="main-nav">
				<li><a href="#">Link 1</a></li>
				<li><a href="#">Link 2</a></li>
				<li><a href="#">Link 3</a></li>
				<li><a href="#">Link 4</a></li>
			</ul>
		</header>
		<div class="main-banner">
			<h1>This is our Main Heading!</h1>
			<p>Bacon ipsum dolor sit amet chicken pork</p>
		</div>
		<div class="primary-content col">
			<h2>Primary Content</h2>
			<p>Bacon ipsum dolor sit amet chicken pork ground round brisket corned beef ball tip shank tail salami filet mignon ham hock pork belly venison shankle. Pig kielbasa drumstick sausage pork chop boudin. Chicken t-bone salami pork chop, beef ribs kevin ham tri-tip beef venison biltong brisket.</p>
			<p>Venison strip steak meatball chicken, brisket prosciutto sirloin. Capicola drumstick brisket tri-tip salami. Chicken beef jerky, tail turkey prosciutto cow ham sirloin boudin tenderloin. Meatloaf tri-tip turducken brisket andouille, pork belly corned beef fatback hamburger.</p>
		</div>
		<div class="secondary-content col">
			<h3>Secondary Content</h3>
			<p>Strip steak tenderloin kevin swine meatloaf capicola, doner beef turducken pancetta corned beef pork loin shoulder.</p>
			<hr>
			<p>Pork filet mignon leberkas, tail swine venison pancetta turkey shoulder brisket chalkers l	ikes hamburgers.</p>
		</div>
		<footer class="main-footer">
			<p>&copy;2014 Example Layout</p>
		</footer>
	</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
	<title>Floats</title>
	<meta name="viewport" content="width=device-width">
	<link rel="stylesheet" href="css/normalize.css">
	<link rel="stylesheet" href="css/style.css">
	<style>

/* Page Styles
================================ */

* {
	-moz-box-sizing: border-box;
	box-sizing: border-box;
}
html,
body {
 height: 100%;
}
body {
	font: normal 1.1em/1.5 sans-serif;
	color: #222;
	background-color: #edeff0;
}

/* Layout Element Colors
================================ */

.main-header       { background-color: #384047; }
.main-logo a       { background-color: #5fcf80; }
.main-nav a        { background-color: #3f8abf; }
.primary-content   { background-color: #caebf6; }
.secondary-content { background-color: #bfe3d0; }
.main-footer       { background-color: #b7c0c7; }

/* Header, Banner and Footer Layout
================================ */

/*.main-wrapper {
	width: 90%;
	margin: auto;
}*/
.main-header {
	padding: 15px;
}
.main-logo,
.main-nav li {
	float: left;
}
.main-logo {
	margin: 0 50px 0 0;
}
.main-nav li {
	margin-top: 15px;
	margin-right: 10px;
	margin-left: 10px;
}
.main-logo a, 
.main-nav a {
	display: block;
	color: white;
	text-decoration: none;
	text-align: center;
	padding: 5px 15px;
	border-radius: 5px;
}
.main-banner {
	background: #dfe2e4;
	text-align: center;
	padding: 35px 15px;
}
.main-footer {
	text-align: center;
	padding-top: 5px;
	padding-bottom: 5px;
}

/* Column Layout
================================ */

.col {
	padding: 20px;
	float: left;
	width: 30%;
}
.primary-content {
	width: 40%;
}
.col:last-child {
	float: right;
}

/* Imagery
================================ */

.feat-img {
	width: 50%;
	float: left;
	margin-top: 10px;
	margin-right: 25px;
	margin-bottom: 10px;
	border: solid 1px;
	padding: 5px;
}

/* Float Clearfix
================================ */

.group:after {
  content: " ";
  display: table;
  clear: both;
}

/* Media Queries
================================ */

@media (max-width: 768px) {
	.main-wrapper,
	.main-nav li, 
	.main-logo,
	.col,
	.feat-img {
		width: initial;
		height: initial;
		float: initial;
	}
	.feat-img {
		width: 100%;
	}
	.main-logo {
		margin-right: 0;
	}
	.extra-content {
		display: none;
	}
}
</style>
</head>
<body>
	<div class="main-wrapper">
		<header class="main-header group">
			<h1 class="main-logo"><a href="#">Logo</a></h1>
			<ul class="main-nav">
				<li><a href="#">Link 1</a></li>
				<li><a href="#">Link 2</a></li>
				<li><a href="#">Link 3</a></li>
				<li><a href="#">Link 4</a></li>
			</ul>
		</header>
		<div class="main-banner">
			<h1>This is the Main Banner Heading</h1>
			<p>Andouille pork chop pancetta drumstick ground round beef ribs swine brisket ham.</p>
		</div>
		<div class="content-row group">
			<div class="extra-content col">
				<h3>Extra Content</h3>
				<p>Filet mignon turkey flank doner strip steak. Frankfurter ham hock turkey, venison sirloin pig chuck shank capicola hamburger doner spare ribs boudin.</p>
				<hr>
				<p> Drumstick bresaola meatloaf ham hock salami tri-tip landjaeger beef filet mignon biltong boudin turkey.</p>
			</div>
			<div class="primary-content col">
				<h2>Primary Content</h2>
				<img class="feat-img" src="http://lorempixel.com/400/300">
				<p>Bacon ipsum dolor sit amet chicken pork ground round brisket corned beef ball tip shank tail salami filet mignon ham hock pork belly venison shankle. Pig kielbasa drumstick sausage pork chop boudin. Chicken t-bone salami pork chop, beef ribs kevin ham tri-tip beef venison biltong brisket.</p>
				<p>Venison strip steak meatball chicken, brisket prosciutto sirloin. Capicola drumstick brisket tri-tip salami. Chicken beef jerky, tail turkey prosciutto cow ham sirloin boudin tenderloin. Meatloaf tri-tip turducken brisket andouille, pork belly corned beef fatback hamburger.</p>
			</div>
			<div class="secondary-content col">
				<h3>Secondary Content</h3>
				<p>Strip steak tenderloin kevin swine meatloaf capicola, doner beef turducken pancetta corned beef pork loin shoulder.</p>
				<hr>
				<p>Pork filet mignon leberkas, tail swine venison pancetta turkey shoulder brisket chalkers likes hamburgers.</p>
			</div>
		</div>
		<footer class="main-footer">
			<p>&copy;2014 Example Layout</p>
		</footer>
	</div>
</body>
</html>