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
Christian Sharkey
1,135 PointsCSS challenge: Difficulty with proper column alignment/floats. please help
Hello Team Treehouse,
I am at a stand still and near a breaking point. i believe i have spent a bit too much time away from my self studies, due to my job and constant travel from state to state, it is hard especially with a road block and only 2-3 hours a night to study. i bought a book and have been studying with that hands on. I have to be honest, the courses on treehouse, i dont seem to pay much attention to and i can blow through them with ease. maybe i havent gone through far enough. the info at times doesn't seem relevant to what i want to know BUT i am not saying it is useless information, i find myself going back and forth, using the teachers notes to redirect me to other sources.
this is my first time actually reaching out for help, i feel if i dont i may end up giving up and i really dont want to do that to myself.
anyway.. i've noticed in other posts there is a way to post code in a nice readable format... I have no idea how to do that. so i am going to do my best to describe with words and paste my code so if you want you may save it as your own index.html, style.css and reset.css and view the project in your browser.
my index.html is this:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Amazeriffic</title>
<link rel="stylesheet" type="text/css" href="reset.css">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<div class="container">
<h1>Amazeriffic</h1>
<nav>
<a href="#">Sign Up!</a> |
<a href="FAQ.html">FAQ</a> |
<a href="#">Support</a>
</nav>
</div>
</header>
<main>
<div class="container">
<div class="content">
<div class="contact">
<h2>Amazeriffic will change your life!</h2>
<p>But I must explain to you how all this mistaken idea of denouncing of a pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness</p>
<h3>Here's why you need Amazeriffic</h3>
<ul>
<li>It fits your lifestyle</li>
<li>It's awesome</li>
<li>It rocks your world</li>
</ul>
</div>
</div>
<div class="img">
<img src="lightbulb.png" alt="an image of a lightbulb">
</div>
</div>
</main>
<footer>
<div class="container">
<h5>Contact Us!</h5>
<p>Amazeriffic!</p>
<p>555 fiftyfifth Street</p>
<p>Moon Base, Moon.</p>
<div class="sitemap">
<h5>Sitemap</h5>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Privacy</a></li>
<li><a href="#">Support</a></li>
<li><a href="#">FAQ</a></li>
<li><a href="#">Careers</a></li>
</ul>
</div>
</div>
</footer>
</body>
</html>
My style.css is this :
body {
background: #f9e933;
}
header, main, footer {
min-width: 855px;
}
header .container, main .container, footer .container {
max-width: 855px;
margin: auto;
}
header {
background: white;
overflow: auto;
}
main {
background: white;
overflow: auto;
}
header h1 {
float: left;
width: 570px;
}
header nav {
float: right;
width: 285px;
}
main .content {
float: left;
width: 570px;
}
main img {
float: right;
width: 285px;
}
main {
overflow: auto;
}
footer .sitemap {
float: right;
width: 285px;
float: top;
}
footer .contact {
float: left;
width: 570px;
}
My browser reset.css is this:
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
Moderator edited: Added markdown so that code renders properly in the forums.
Jennifer Nordell
Treehouse TeacherHi there Christian Sharkey ! I added some markdown to your question so that the code becomes more readable and renders properly on the forums. If you'll look at the "Markdown Cheatsheet" link at the bottom of the "Add an Answer" section here on this page, you can find instructions on how to add markdown to your posts!
1 Answer
Sam Deighton II
25,602 PointsNot sure that I understand what your two questions are:
- Need more clarification on what needs fixing
- You want Contact Us and Sitemap in the same row but opposite sides?
Christian Sharkey
1,135 PointsChristian Sharkey
1,135 Pointsperhaps if i knew how to properly add code into a box i could resubmit it and it would be a lot easier to view.
anyway, to actually ask the question i wish i knew how to show you an image of the web page that i am viewing. but i can do my best to describe it in words.
the h1 at the top has the same width and margin as the h2 and the p elements but yet. the h2 and the p elements are indented but should be aligned.
the contact info and the site map. they have a split width, totaling 855px. as you can see i have tried using a float element to move it over but on the web page it is in fact floated to the right but it is below the contact info.. I apologise i am quite tired and i have spent quite a bit of time away from code. i realize i have some mistakes with my css but that was just me trying to figure out if certain codes would work.
i have been through this chapter in my book 3 times and should probably go through a 4th to refresh my vocab. but the code is all there and i would GREATLY appreciate it if someone took their time to explain why it looks so bad..
should i just move on and keep styling it and perhaps it will fix itself? i have read that certain browsers, even with a reset code will display things differently as well as different operating systems, they too, will display code differently. maybe its just my computer?
Thanks.