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
Ryan Moulder
7,355 PointsBackground keeps breaking around the footer area
https://w.trhou.se/da5fg6kjs5 Here is my work. I honestly have no idea why it is breaking like it is.
3 Answers
Artem Shturkin
Courses Plus Student 8,359 PointsHi, if I understand your problem right , here is one of the decisions. Try to add height: 100vh; property for class .main-body , like this
.main-body {
height: 100vh;
background: radial-gradient(red, orange, yellow, green, blue, indigo, violet);
}
lonedo
24,500 PointsA Footer isn't declared inside your html, Your Div should be inside the <body> tag, and the background is only being declared for the .main-body div, thus why it doesn't cover the actual page.
That and you may need to zoom in further for the content to cover your screen. If you are using Chrome, you can use the "Chrome Dev tools" by right clicking a page and selecting "inspect" or hitting F12. From their you can see the true visual size of each item on the page. Very Useful,
Simple fix is to change your main.css from
.main-body {
background: radial-gradient(red, orange, yellow, green, blue, indigo, violet);
}
To this
body {
background: radial-gradient(red, orange, yellow, green, blue, indigo, violet);
background-repeat: no-repeat;
}
Hope this helps mate,
Pierre Lindgren
1,905 PointsHello Ryan,
First in your main.css you have an empty background attribute, This should be removed.
Second your index.html is nested incorrectly. I did some changes to it.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Gibson County Animal Shelter</title>
<link rel="stylesheet" href="normalize.css">
<link href="https://fonts.googleapis.com/css?family=Cinzel|Forum|Kanit|Lobster+Two|Raleway" rel="stylesheet">
<link rel="stylesheet" href="main.css">
</head>
<body>
<center>
<div class="main-body">
<div class="heading">
<h1>Gibson County Animal Shelter</h1>
<nav>
<ul>
<li>Home</li>
<li>Meet the Animals</li>
<li>Reviews</li>
<li>About</li>
<li>Meet Mike</li>
<li>Adoption</li>
</ul>
</nav>
</div>
<div class="body">
<h2>Home Page</h2>
<section>
<p>******GC ANIMAL SHELTER INFO******</p>
</section>
<h2>Map</h2>
<section>
<p>Here is a map. Our address is 1252B Manufacturer's Row, Trenton, Tennessee 38382.</p>
</section>
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3229.7567503562473!2d-88.95017743256625!3d35.95292006628291!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x88794d82741baa3b%3A0x94a4a16fde8b50d0!2sGibson+County+Animal+Shelter!5e0!3m2!1sen!2sus!4v1489178459819" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>
</div>
</div>
</center>
</body>
</html>
Hope this helps.
Kind regards