Skip to content

Instantly share code, notes, and snippets.

@nomanson
Created September 14, 2014 20:25
Show Gist options
  • Save nomanson/e5323a4bf89d4823258c to your computer and use it in GitHub Desktop.
Save nomanson/e5323a4bf89d4823258c to your computer and use it in GitHub Desktop.
46h 2014E, 1. semester, Exercise 3.2 - layout.html: Basic HTML layout using relative positioning and floats.
/* general tag styles */
html {
/* background: #ccc url('../images/960_grid_12_col.png') top center no-repeat; */
}
body {
font-family:verdana,helvetica,sans-serif;
width:960px;
margin:auto;
color:#fff;
font-size:16px
/* opacity: 0.8; */
}
h1,h2 {
padding-top:1em;
padding-bottom:.5em
}
h1 {
font-size:2em
}
h2 {
font-size:1.6em
}
ul {
list-style-type:disc;
list-style-position:inside;
padding:1em;
padding-left:0
}
ul li {
padding:.2em
}
/* layout tag styles */
header {
background:green;
height:160px;
padding:10px
}
nav {
background:#ff0;
height:40px;
color:#a52a2a
}
nav ul {
padding:0
}
nav ul li {
display:inline-block;
width:140px;
padding:9px;
padding-top:5px;
padding-bottom:5px;
line-height:30px;
vertical-align:middle;
border-right:2px solid #fff;
text-align:center;
overflow:hidden
}
article {
background:#d2691e;
overflow:hidden
}
article section {
width:700px;
padding:10px
}
aside {
background:#8a2be2;
width:200px;
min-height:700px;
float:right;
padding:10px;
overflow:hidden
}
footer {
background:green;
height:120px;
padding:10px
}
article section table {
width:100%
}
article section table td {
border:1px solid #fff;
padding:10px
}
/* content styles */
#table_aside {
width:33%;
height:200px
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="Jan Ingemansen" name="author">
<link href="css/reset_html5.css" rel="stylesheet" type="text/css">
<link href="css/default.css" rel="stylesheet" type="text/css">
<title>
Generic Page Layout
</title>
</head>
<body>
<header>
<h1>
Generic Page Layout
</h1>
</header>
<nav>
<ul>
<li>menu 1
</li>
<li>menu 2
</li>
<li>menu 3
</li>
</ul>
</nav>
<article>
<aside>
<h2>
Aside
</h2>
</aside>
<section>
<h2>
Specifications
</h2>
<ul>
<li>width: 960px;
</li>
<li>margin: auto;
</li>
<li>padding overall - padding: 10px;
</li>
</ul>
<table>
<tr>
<td colspan="2">
&#60;header&#62;
<ul>
<li>height: 160px;
</li>
</ul>
</td>
</tr>
<tr>
<td colspan="2">
&#60;nav&#62;
</td>
</tr>
<tr>
<td>
&#60;article&#62;
<ul>
<li>overflow: hidden;
</li>
</ul>&#60;section&#62;
<ul>
<li>width: 700px;
</li>
</ul>
</td>
<td id="table_aside">
&#60;aside&#62;
<ul>
<li>width: 200px;
</li>
<li>min-height: 700px;
</li>
</ul>
</td>
</tr>
<tr>
<td colspan="2">
&#60;footer&#62;
<ul>
<li>height: 120px;
</li>
</ul>
</td>
</tr>
</table>
</section>
</article>
<footer>
&copy; Jan Ingemansen 2014
</footer>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment