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 trialakhil maddu
1,422 PointsHow do I remove spaces between header,body,footer when i wrap all these in div and set it to wdth:740px; margin:auto?
in this video gil uses different colors for footer ,header and footer and there is no spaces between then.when i create on my own i can see spaces between then.So ,how do i avoid it?
3 Answers
Richard Duffy
16,488 PointsHey, can you paste your code please?
Richard Duffy
16,488 Points<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, inital-scale=1">
<title>Test</title>
<style>
.container{
margin:auto;
width:800px;
}
.main-header{
height:100px;
color:white;
background-color:black;
}
.main-content{
padding:30px;
background-color:green;
}
</style>
</head>
<body>
<div class="container">
<p class="main-content">
The Indian cricket team won the 2011 Cricket World Cup under his captainship. His Test cricket and One Day International records are the best among all Indian captains to date. He took over the ODI captaincy from Rahul Dravid in 2007 and led the team to its first ever inter-country ODI series wins in Sri Lanka and New Zealand. Dhoni also holds the post of Vice-President of India Cements Ltd. after resigning from Air India. India Cements is the owner of the Indian Premier League team Chennai Super Kings, and Dhoni has been its captain since the first edition of IPL.[5][6]
</p>
</div>
</div>
</body>
</html>
Is this the code you want? I can't see that you have added a footer element or a footer class so that is why the footer is not displaying.
akhil maddu
1,422 Pointsakhil maddu
1,422 Points<html> <head>
<style>
.container{
width:800px; margin:auto;
}
.main-header{
height:100px; color:white; background-color:black;
} .main-content{ padding:30px; background-color:green;
}
</style>
</head>
<body> <div class="container"> <header class="main-header">myhead</header>
<!-- <div class="main-content">--> <p class="main-content">
</htm> l