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

CSS align-items 속성 스트레치 값 사용

<시간/>

정렬 항목 사용 값 stretch가 있는 속성 플렉스 아이템을 늘리기 위해.

다음 코드를 실행하여 stretch를 구현할 수 있습니다. 가치

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