>웹 프론트엔드 >CSS 튜토리얼 >CSS 조정 콘텐츠

CSS 조정 콘텐츠

王林
王林앞으로
2023-09-17 11:45:04855검색

CSS 调整内容

Flex 항목을 정렬하려면 justify-content 속성을 사용하세요. justify-content 속성을 구현하려면 다음 코드를 실행해 보세요.

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         .mycontainer {
            display: flex;
            background-color: orange;
            justify-content: center;
         }
         .mycontainer > div {
            background-color: white;
            text-align: center;
            line-height: 40px;
            font-size: 25px;
            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>

위 내용은 CSS 조정 콘텐츠의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
이 기사는 tutorialspoint.com에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제