저는 HTML과 CSS 및 스택 오버플로 커뮤니티에 익숙하지 않습니다. 과제 중 하나에 대해 컨테이너 <div>
에 서로 <div>
을 균등하게 배치해야합니다. 내측 <div>
각각에 대해 float:left
을 사용했습니다. 하지만 그렇게하면 바깥 쪽 (컨테이너) div가 최상위로 끝까지 축소됩니다. 내가 이해해야 할 것은 부유 요소가 정상적인 흐름에 배치 된 후 콘텐츠와 요소의 정상적인 흐름에서 벗어났다는 것입니다.
플로팅 요소의 작업 스타일은 물론 display:inline-block
도 이해해야합니다. 어떤 도움이라도 대단히 감사하겠습니다. 가장 간단한 형태의 샘플 태그는 다음과 같습니다divs의 동작 이해 및
<style>
#xouter{
width:80%;
margin-left:9%;
border:1px solid #000;
}
#xleftcol{
float: left;
width: 33%;
background:#809900;
}
#xmiddlecol{
float: left;
width: 34%;
background:#eff2df;
}
#xrightcol{
float:left;
width: 33%;
background:#d2da9c;
}
</style>
<body>
<div id="xouter">
<div id="xleftcol">
This is the left col : This is the left col :This is the left col :This is the left col :This is the left col :This is the left col :This is the left col :This is the left col :This is the left col :This is the left col :This is the left col
</div>
<div id="xmiddlecol">
This is the middlecol: This is the middlecol: This is the middlecol: This is the middlecol: This is the middlecol: This is the middlecol: This is the middlecol: This is the middlecol: This is the middlecol: This is the middlecol: This is the middlecol: This is the middlecol:
</div>
<div id="xrightcol">
This is the rightcol : This is the rightcol : This is the rightcol : This is the rightcol : This is the rightcol : This is the rightcol : This is the rightcol ::
</div>
</div>
</body>
css의'.'는'클래스'를 참조하고'# '은'id'를 참조합니다. https://codepen.io/anon/pen/BRLmRV –
질문이 있습니까? 질문이 뭐야? – garek007