box-sizing: content-box(기본), border-box
<html>
<title>
</title>
<style>
.box1 {
box-sizing: content-box;
width: 300px;
height: 150px;
margin: 10px;
padding: 30px;
border: 2px solid red;
}
.box2 {
box-sizing: border-box;
width: 300px;
height: 150px;
margin: 10px;
padding: 30px;
border: 2px solid red;
}
</style>
<body>
<div class="box1"></div>
<div class="box2"></div>
</body>
</html>
float: left, right, none
clear: none, left, right, both
<html>
<title>
</title>
<style>
.left-img {
float: left;
margin-right:15px;
}
.box1 {
float: left;
background: red;
padding: 20px;
margin-right: 10px;
}
.box2 {
float: left;
background: blue;
padding: 20px;
margin-right: 10px;
}
.box3 {
/* float: left; */
background: yellow;
padding: 20px;
margin-right: 10px;
}
.box4 {
/* float: right; */
/* clear: both; */
/* float: none; */
background: green;
padding: 20px;
margin-right: 10px;
}
</style>
<body>
<img src="./logo.svg" class="left-img"width="100px" height="100px">
<h1>Tomato</h1>
<p>토마노토마마마마모노노토토토</p>
<div>
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
<div class="box4"></div>
</div>
</body>
</html>