margin: ***;
Browser |
|
---|
The margin property sets the margins around an element.
Applying this property to the BODY element applies the specified style to an entire page.
body {
margin: 5px 10px 15px 20px;
}
Property | Value | Explanation |
---|---|---|
margin | length, %, or auto | the top, bottom, left, and right margins |
margin: 2px;
: [all sides] marginsmargin: 2px 4px;
: [top, bottom] [left, right] marginsmargin: 2px 4px 6px;
: [top] [left, right] [bottom] marginsmargin: 2px 4px 6px 8px;
: [top] [right] [bottom] [left] margins
Example
<html>
<head>
<title>TAG index</title>
<style type="text/css">
body {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
</body>
</html>
- Output
-
Example page