This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29840 - Margin top Bug in body
Summary: Margin top Bug in body
Status: NEW
Alias: None
Product: CSS
Classification: Unclassified
Component: Box model (show other bugs)
Version: unspecified
Hardware: All Linux
: P2 normal
Target Milestone: ---
Assignee: Bert Bos
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-21 09:35 UTC by Akhil
Modified: 2016-09-21 09:35 UTC (History)
0 users

See Also:


Attachments
body bg color is red and wrapper color is white. i have a haeder class inside wrapper a. and its has a margintop 100px . But wrapper also getting a margin top 100px. padding instead of margin works fi (52.76 KB, image/png)
2016-09-21 09:35 UTC, Akhil
Details

Description Akhil 2016-09-21 09:35:49 UTC
Created attachment 1655 [details]
body bg color is red and wrapper color is white. i have a haeder class inside wrapper a. and its has a margintop 100px . But wrapper also getting a margin top 100px. padding instead of margin works fi

<!DOCTYPE html>
<html>
<head>
<style>
body{
	background-color: red;
	margin: 0px;
	height: 100%;
}
.wrapper{
	background-color: #fff;
	height: auto;
	display: block;
	vertical-align: top;
}

.header{
	margin-top: 100px;
	display: block;
}
</style>
</head>
<body>

<div class="wrapper">	
		<div class="header">jjj</div>
		<div class="content">lll</div>
	</div>

</body>
</html>
i have applied margin top only to header class but wrapper also getting a margin