Skip to content

Instantly share code, notes, and snippets.

@yamoo9
Created November 1, 2014 09:32
Show Gist options
  • Save yamoo9/069969d8a890ffb3d067 to your computer and use it in GitHub Desktop.
Save yamoo9/069969d8a890ffb3d067 to your computer and use it in GitHub Desktop.
Float 설명
<!DOCTYPE html>
<html lang="ko-KR">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta charset="UTF-8">
<title>Float Design</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<style>
.fl { float: left; }
.fr { float: right; }
.container {
/*overflow: hidden;*/
background: #fffc0a;
}
.cf::before, .cf::after {
display: table;
content: '';
}
.cf::after {
clear: both;
}
.clearfix::after {
content: '';
display: block;
clear: both;
/*visibility: hidden;
height: 0;*/
}
[class^="box-"] {
width: 100px;
height: 100px;
background: #000;
color: #fff;
text-align: center;
line-height: 100px;
}
.box-01 {background: #fe4940;}
.box-03 {background: #3fb5c8;}
/*.clearfix {
clear: both;
}*/
</style>
</head>
<body>
<div class="container clearfix">
<div class="box-01 fl">box 01</div>
<div class="box-02 fl">box 02</div>
<div class="box-03 fl">box 03</div>
<!-- <div class="clearfix"></div> -->
</div>
<div class="container cf">
<div class="box-02 fl">box 02</div>
<div class="box-03 fl">box 03</div>
<div class="box-01 fl">box 01</div>
<!-- <div class="clearfix"></div> -->
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment