Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Asia Chan
11,007 PointsWas able to finish the code on my own. Just want to ask what I did are good coding practice
Hi! Just want to ask for your opinion regarding the soundness of my code. Any improvements or suggestions are highly appreciated. Thanks!
Here's the link to my Workspace project: https://teamtreehouse.com/workspaces/24367532
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Best City Guide</title>
<link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="footer-wrapper">
<header class="main-header clearfix">
<div class="centered clearfix">
<h1 class="name"><a href="#">Best City Guide</a></h1>
<ul class="main-nav">
<li><a href="#">ice cream</a></li>
<li><a href="#">donuts</a></li>
<li><a href="#">tea</a></li>
<li><a href="#">coffee</a></li>
</ul>
</div><!--/.centered-->
</header><!--/.main-header-->
<div class="banner clearfix">
<div class="centered">
<img class="logo" src="img/city-logo.svg" alt="City">
<h1 class="headline">The Best City</h1>
<span class="tagline">The best drinks and eats in the best city ever.</span>
</div><!--/.centered-->
</div><!--/.banner-->
<div class="content-wrap">
<div class="centered clearfix">
<div class="secondary col">
<h2>Welcome!</h2>
<p>Everything in this city is worth waiting in line for.</p>
<p>Cupcake ipsum dolor sit. Amet chocolate cake gummies jelly beans candy bonbon brownie candy. Gingerbread powder muffin. Icing cotton candy. Croissant icing pie ice cream brownie I love cheesecake cookie. Pastry chocolate pastry jelly croissant.</p>
<p>Cake sesame snaps sweet tart candy canes tiramisu I love oat cake chocolate bar. Jelly beans pastry brownie sugar plum pastry bear claw tiramisu tootsie roll. Tootsie roll wafer I love chocolate donuts.</p>
</div><!--/.secondary-->
<div class="primary col">
<h2>Great food</h2>
<img class="feat-img" src="img/treats.svg" alt="Drinks and eats">
<p>Croissant macaroon pie brownie. Cookie marshmallow liquorice gingerbread caramels toffee I love chocolate. Wafer lollipop dessert. Bonbon jelly beans pudding dessert sugar plum. Marzipan toffee dragée chocolate bar candy toffee pudding I love. Gummi bears pie gingerbread lollipop.</p>
</div><!--/.primary-->
<div class="tertiary col">
<h2>How to get here</h2>
<p><strong>Plane: </strong>Tiramisu caramels gummies chupa chups lollipop muffin. Jujubes chocolate caramels cheesecake brownie lollipop dragée cheesecake.</p>
<p><strong>Train: </strong>Pie apple pie pudding I love wafer toffee liquorice sesame snaps lemon drops. Lollipop gummi bears dessert muffin I love fruitcake toffee pie.</p>
<p><strong>Car: </strong>Jelly cotton candy bonbon jelly-o jelly-o I love. I love sugar plum chocolate cake pie I love pastry liquorice.</p>
</div><!--/.tertiary-->
</div><!--/.centered-->
</div><!--/.content-wrap-->
</div><!--/.footer-wrapper-->
<footer class="main-footer clearfix">
<span>©2015 Residents of The Best City Ever.</span>
</footer>
</body>
</html>
/* =================================
Base Element Styles
==================================== */
* {
box-sizing: border-box;
}
body {
font-family: 'Varela Round', sans-serif;
line-height: 1.6;
color: #3a3a3a;
}
p {
font-size: .95em;
margin-bottom: 1.8em;
}
h1 {
margin: 0; /* Added */
}
h2,
h3,
a {
color: #093a58;
}
h2,
h3 {
margin-top: 0;
}
a {
text-decoration: none;
}
img {
max-width: 100%;
}
/* =================================
Base Layout Styles
==================================== */
/* ---- Navigation ---- */
.name {
font-size: 1.25em;
}
.name a,
.main-nav a {
text-align: center;
}
.main-nav a {
font-size: .95em;
color: #3acec2;
text-transform: uppercase;
}
.main-nav a:hover {
color: #093a58;
}
/* ---- Layout Containers ---- */
.main-header { /* Added */
margin: 1em 0;
}
.centered { /* Added */
width: 70%;
margin: auto;
}
.banner {
color: #fff;
background: #3acec2;
padding: 2em 1em; /* Added */
text-align: center; /* Added */
}
.main-footer {
background: #d9e4ea;
padding: 2em 2em;
margin-top: 30px;
text-align: center; /* Added */
}
/* ---- Page Elements ---- */
.logo {
width: 190px;
padding-bottom: 1em;
}
.col {
margin: 2em 0; /* Added */
}
/* ---- Sticky Footer---- */
.footer-wrapper {
min-height: calc(100vh - 89px);
}
/* =================================
Media Queries
==================================== */
/* ----------- iPhone 6+ ----------- */
/* Portrait and Landscape */
@media only screen and (min-width: 300px) {
.centered {
width: 80%;
margin: 0 auto;
max-width: 768px
}
/* ---- Navigation ---- */
.name,
.main-nav {
display: block;
padding: 0.1em 0;
text-align: center;
}
.name a,
.main-nav a {
display: block;
}
.name a {
margin: 0.4em;
}
.main-nav a {
padding-bottom: 0.4em;
}
/* ---- Float clearfix ---- */
.clearfix::after {
content: " ";
display: table;
clear: both;
}
}
/* ----------- iPad 3 and 4 ----------- */
/* Portrait and Landscape */
@media only screen and (min-width: 768px) {
/* ---- Layout Containers ---- */
.centered {
width: 90%;
margin: 0 auto;
}
/* ---- Navigation ---- */
.name,
.name a,
.main-header,
.main-nav,
.main-nav li,
.main-nav a {
margin: 0;
padding: 0;
}
.name,
.main-nav,
.main-nav li {
display: inline-block;
}
.name a,
.main-nav a {
display: block;
}
.main-header {
margin: 1em 0;
}
.main-nav {
padding-top: 0.3em; /* aligned to .name */
float: right;
}
.main-nav li {
padding-left: 2.5em;
}
/*
.name,
.main-nav,
.main-nav li {
display: inline;
margin: 0.5em;
}
*/
.name {
float: left;
margin-left: 0;
}
.main-nav,
.main-nav li:last-child {
margin-right: 0;
}
/* ---- Page Elements ---- */
.banner {
margin: 0;
padding: 2.5em 0;
}
.content-wrap {
margin: 3em 0;
}
.col {
vertical-align: top;
float: left;
margin: 0;
}
.primary,
.secondary,
.tertiary {
width: 50%;
}
.primary {
padding-right: 0;
padding-left: 0.5em;
}
.secondary,
.tertiary {
padding-left: 0;
padding-right: 1.5em;
}
/* ---- Float clearfix ---- */
.clearfix::after {
content: " ";
display: table;
clear: both;
}
}
/* ----------- Retina Screens ----------- */
@media screen
and (min-width: 1200px) {
/* ---- Layout Containers ---- */
.centered {
width: 85%;
margin: 0 auto;
max-width: 1200px
}
/* ---- Navigation ---- */
.name,
.name a,
.main-header,
.main-nav,
.main-nav li,
.main-nav a {
margin: 0;
padding: 0;
}
.name,
.main-nav,
.main-nav li {
display: inline-block;
}
.name a,
.main-nav a {
display: block;
}
.main-header {
margin: 1em 0;
}
.main-nav {
padding-top: 0.3em; /* aligned to .name */
float: right;
}
.main-nav li {
padding-left: 2.5em;
}
.name {
float: left;
margin-left: 0;
}
.main-nav,
.main-nav li:last-child {
margin-right: 0;
}
/* ---- Page Elements ---- */
.banner {
margin: 0;
padding: 2.5em 0;
}
.content-wrap {
margin-top: 3em;
margin-bottom: 2.5em;
}
.col {
vertical-align: top;
float: left;
margin: 0;
padding: 0;
padding-right: 2em;
}
.secondary,
.tertiary {
width: 27.5%;
}
.primary {
width: 45%;
}
.secondary {
padding-left: 0;
}
.tertiary {
padding-right: 0;
}
/* ---- Float clearfix ---- */
.clearfix::after {
content: " ";
display: table;
clear: both;
}
}
Thanks in advance!
1 Answer
Savannah Lynn
13,662 PointsOnly suggestion I would give is check your indention styles. Since your <div class="footer-wrappper"> contains ALL of your content. Everything inside that should be indented. :)
Asia Chan
11,007 PointsAsia Chan
11,007 PointsHi Savannah, thanks! ?