@Flex [0509]

왕감자·2024년 5월 9일

KB IT's Your Life

목록 보기
7/177

Flex : 일괄적으로 자식 요소들을 가로 배치

<html lang="en">
  <head>
    <title>Flex</title>
    <style>
      .flex-container {
        display: flex;
        background-color: dodgerblue;
        flex-wrap: nowrap;
        margin: 0 auto;
      }
      .flex-container > div {
        background-color: #f1f1f1;
        width: 100px;
        margin: 10px;
        text-align: center;
        line-height: 75px;
        font-size: 30px;
      }
    </style>
  </head>
  <body>
    <h1>Flexible Boxes</h1>

    <div class="flex-container">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
      <div>6</div>
      <div>7</div>
      <div>8</div>
    </div>
  </body>

0개의 댓글