programming-examples/css/Div tag margin-top margin-bottom margin-left margin-right.html
2019-11-15 12:59:38 +01:00

34 lines
930 B
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:subLang='en'>
<head>
<title>Div Tag Margin Top Margin Bottom Margin Left Margin Right</title>
<style rel='stylesheet' type='text/css'>
body {
margin: 0;
padding: 0;
}
div {
width: 400px;
height: 250px;
background: pink;
border: 1px solid pink;
}
div#topbottom-rightleft1 {
margin-top: 20px;
margin-right: 8px;
margin-bottom: 20px;
margin-left: 8px;
}
div#topbottom-rightleft2 {
margin: 20px 8px;
}
</style>
</head>
<body>
<div id='topbottom-rightleft1'>Absence sharpens love, presence strengthens it. Thomas Fuller </div>
<div id='topbottom-rightleft2'>Absence sharpens love, presence strengthens it. Thomas Fuller </div>
</body>
</html>