block have three visuals: margin, padding, border
margin is the spaces from the border of the box to the outside.
<html>
<head>
<style>
html {
background-color: gray;
}
div {
height: 200px;
width: 200px;
background-color: thistle;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
<html>
<head>
<style>
html {
background-color: gray;
}
body {
background-color: steelblue;
div {
height: 200px;
width: 200px;
background-color: thistle;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
<html>
<head>
<style>
html {
background-color: gray;
}
body {
background-color: steelblue;
margin: 0;
div {
height: 200px;
width: 200px;
background-color: thistle;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
'HTML CSS' 카테고리의 다른 글
KokoaTalk Clone Coding: CSS padding 1 (0) | 2021.05.02 |
---|---|
KokoaTalk Clone Coding: CSS collapsing margins (0) | 2021.05.02 |
KokoaTalk Clone Coding: CSS blocks and lnlines (0) | 2021.05.02 |
KokoaTalk Clone Coding: How to add CSS to HTML (0) | 2021.05.02 |
KokoaTalk clone coding: HTML more tags (0) | 2021.05.02 |