HTML의 Layout은 웹페이지를 구성하는 요소들을 배치하는 방법을 의미해요. 웹페이지에서 텍스트, 이미지, 버튼 같은 요소들이 어디에, 어떻게 놓일지를 정하는 거죠. HTML로 기본 구조를 만든 뒤, CSS를 사용해 레이아웃을 꾸미고 조정합니다.
<div style="display: flex; justify-content: center; align-items: center; height: 200px; background: lightblue;">
<div style="width: 100px; height: 100px; background: coral;">A</div>
<div style="width: 100px; height: 100px; background: teal;">B</div>
<div style="width: 100px; height: 100px; background: gold;">C</div>
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; background: lightgray;">
<div style="background: coral;">1</div>
<div style="background: teal;">2</div>
<div style="background: gold;">3</div>
<div style="background: lightgreen;">4</div>
</div>
<div style="overflow: hidden;">
<div style="float: left; width: 30%; height: 100px; background: coral;">Left</div>
<div style="float: left; width: 70%; height: 100px; background: lightblue;">Right</div>
</div>
Flex와 Grid는 현대적인 레이아웃 설계에서 가장 많이 사용됩니다. 🙂