float : ​The clear Property(clear 속성) > 퍼블리셔팁

퍼블리셔팁

퍼블리싱과 관련된 유용한 정보를 공유하세요.
질문은 상단의 QA에서 해주시기 바랍니다.

float : ​The clear Property(clear 속성) 정보

CSS float : ​The clear Property(clear 속성)

본문

​The clear Property(clear 속성) 

 

이 clear속성은 부동 요소의 동작을 제어하는 ​​데 사용됩니다.

 

떠 다니는 요소 뒤에있는 요소는 그 주위로 흐를 것입니다. 이를 피하려면 clear속성을 사용하십시오 .

 

이 clear속성은 요소의 어느면에 부동 요소가 뜨도록 허용되지 않는지 지정합니다.

 

Example

div {

    clear: left;

}

 

 

 

<!DOCTYPE html>

<html>

<head>

<style>

.div1 {

    float: left;

    width: 100px;

    height: 50px;

    margin: 10px;

    border: 3px solid #73AD21;

}

 

.div2 {

    border: 1px solid red;

}

 

 

.div3 {

    float: left;

    width: 100px;

    height: 50px;

    margin: 10px;

    border: 3px solid #73AD21;

}

 

.div4 {

    border: 1px solid red;

    clear: left;

}

</style>

</head>

<body>

 

<h2>Without clear</h2>

<div class="div1">div1</div>

<div class="div2">div2 - Notice that the div2 element is after div1, in the HTML code. However, since div1 is floated to the left, this happens: the text in div2 is floated around div1, and div2 surrounds the whole thing.</div>

 

<h2>Using clear</h2>

<div class="div3">div3</div>

<div class="div4">div4 - Using clear moves div4 down below the floated div3. The value "left" clears elements floated to the left. You can also clear "right" and "both".</div>

 

</body>

</html>

 

 

51225d97d5e04df7a1f46dc37d689027_1491827593_7373.png
 

추천
0

댓글 0개

전체 1,263
퍼블리셔팁 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT