2014-01-07 4 views

답변

0

float:left; clear:both;을 사용하는 대신 display:inline-block을 사용하십시오.

작업 : 디스플레이 차이 파악 : block/inline/inline-block 단계;

DEMO & CODE

0

그것은 부유 요소는 잘 알려진 문제이다. 당신은 소위 clearfix 방법이 필요합니다 http://css-tricks.com/snippets/css/clear-fix/

#dad:after { 
    content: ""; 
    display: table; 
    clear: both; 
} 

또는 코드에서 나중에 다시 사용할 수있는 클래스합니다 아이디의

.clrfx:after { 
    content: ""; 
    display: table; 
    clear: both; 
} 

업데이트 된 DEMO

0

변경하십시오 CSS를 # 아래 주소 :

#dad { 
float:left; 
height:100%; 
width:100px; 
border:1px solid black; 
} 
관련 문제