Computer >> 컴퓨터 >  >> 프로그램 작성 >> CSS

CSS에서 줄 사이에 공백이 있는 플렉스 항목 표시

<시간/>

콘텐츠 정당화 사용 값이 사이에 공백인 속성 줄 사이에 공백을 추가합니다.

다음 코드를 실행하여 값 사이의 공백을 구현할 수 있습니다. −

<!DOCTYPE html>
<html>
   <head>
      <style>
         .mycontainer {
            display: flex;
            background-color: red;
            justify-content: space-between;
         }
         .mycontainer > div {
            background-color: white;
            text-align: center;
            line-height: 60px;
            font-size: 30px;
            width: 100px;
            margin: 5px;
         }
      </style>
   </head>
   <body>
      <h1>Quiz</h1>
      <div class = "mycontainer">
         <div>Q1</div>
         <div>Q2</div>
         <div>Q3</div>
         <div>Q4</div>
      </div>
   </body>
</html>