Corraggiouno
Mitglied
Hallo mein HTML-Code:
mein css-code
Kann mir jemand den Unterschied zwischen margin und padding im Body-Bereich erklären? ......also wenn ich z.b. für margin 50 px und für padding:0px eingebe, also genau anders herum, erziele ich das gleiche ergebnis!
Code:
<html>
<head><title></title>
<link rel="stylesheet" type="text/css" href="test.css">
</head>
<body>
<div id="box">
hallo
</div>
</body>
</html>
mein css-code
Code:
body {
margin:0px;
padding:50px;
}
#box {
background: #ffffff;
border: 1px solid blue;
font-family: Verdana;
font-size: 12px;
color: #333;
position:relative;
margin: 0px auto;
width: 500px;
height: 600px;
padding-left:10px;
}