melius
[CSS] Clearfix 본문
How To Clear Floats (Clearfix)
https://www.w3schools.com/howto/howto_css_clearfix.asp
<style>
.clearfix1 {
overflow: auto; /* or hidden */
}
.clearfix2::after {
content: "";
clear: both;
display: table; /* or block */
}
.parent {
background-color: aqua;
}
.box {
background-color: blueviolet;
width: 100px;
height: 100px;
float: right;
}
</style>
<div class="parent clearfix1">
<div class="box"></div>
</div>
'HTML CSS' 카테고리의 다른 글
[CSS] 가상 클래스와 가상 요소 (0) | 2019.12.24 |
---|---|
[CSS] Stacking with floated blocks (0) | 2019.12.23 |
[CSS] Space under <img> tag (0) | 2019.12.23 |
[CSS] 마진 상쇄 (0) | 2019.12.20 |
[CSS] Box Model (0) | 2019.12.20 |
Comments