Skip to content

Instantly share code, notes, and snippets.

@afidegnum
Created June 8, 2019 09:07
Show Gist options
  • Save afidegnum/550027f2d3496c7c48099af8dad5969c to your computer and use it in GitHub Desktop.
Save afidegnum/550027f2d3496c7c48099af8dad5969c to your computer and use it in GitHub Desktop.
Practice: HTML/CSS Layout
<body>
<div id="wrapper">
<div id="header">
<h1>Logo</h1>
<div id="nav">
<ul>
<li><a href="">Home</a></li>
<li><a href="">Products</a></li>
<li><a href="">Services</a></li>
<li><a href="">About</a></li>
<li><a href="">Contact</a></li>
</ul>
</div>
</div>
<div id="content">
<div id="feature">
<p>Feature</p>
</div>
<div class="article column1">
<p>Column One</p>
</div>
<div class="article column2">
<p>Column Two</p>
</div>
<div class="article column3">
<p>Column Three</p>
</div>
</div>
<div id="footer">
<p>&copy; Copyright 2011</p>
</div>
</div>
</body>
body {
width: 90%;
margin: 0 auto;
background-color: lightgrey;
}
#wrapper {
background-color: white;
}
h1 {
margin: 1% 0%;
padding: .25em;
background-color: #efefef;
}
ul {
text-align: center;
}
h1, p {
text-align: center;
}
#content {
overflow: auto;
}
#nav, #feature, #footer {
margin: 1% 0%;
}
/*
.column1, .column2, .column3 {
width: 31.3%;
float: left;
margin: 1%;
}
.column3 {
margin-right: 0%;
}*/
.column1, .column2, .column3 {
width: 31.3%;
float: left;
}
.column1 {
float: left;
}
.column2 {
margin: 0% 3%;
}
.column3 {
float: right;
margin: 0%;
}
li {
display: inline;
padding: 0.5em;
}
#nav, #footer {
background-color: #efefef;
padding: 0.5em 0;
}
#feature, .article {
background-color: #efefef;
height: 10em;
margin-bottom: 1em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment