CSS로 반응형 스타터 템플릿을 만들었습니다.
모든 프로젝트에서 자유롭게 수정, 저장, 공유 및 사용할 수 있습니다.
<style> * 23; box-sizing: border-box; 25; body 23; font-family: Arial, Helvetica, sans-serif; 25; /* Style the header */ .header 23; background-color: #f1f1f1; padding: 30px; text-align: center; font-size: 35px; 25; /* Create three equal columns that floats next to each other */ .column 23; float: left; width: 33.33%; padding: 10px; height: 300px;/* Should be removed. Only for demonstration */ 25; /* Clear floats afterthe columns */ .row:after 23; content:""; display: table; clear: both; 25; /* Style the footer */ .footer 23; background-color: #f1f1f1; padding: 10px; text-align: center; 25; /* Responsive layout - makes the three columns stack on top of each other instead of next to each other. */ @media (max-width: 600px) 23; .column23; width: 100%; 25; 25; </style> </head> <body> <h2>CSS Template using Float</h2> <p> In this example, we have created a header, three qeual columns and a footer. On smaller screens, the columns will stack on top of each other. </p> <p>Resize the browser window to see the responsive effect.</p> <div class="header"> <h2>Header</h2> </div> <div class="row"> <div class="column" style="background-color:#aaa">Column 1</div> <div class="column" style="background-color:#bbb">Column 2</div> <div class="column" style="background-color:#ccc">Column 3</div> </div> <div class="footer"> <p>Footer</p> </div> </body>
<style> * 23; box-sizing: border-box; 25; body 23; font-family: Arial, Helvetica, sans-serif; 25; /* Style the header */ .header 23; background-color: #f1f1f1; padding: 30px; text-align: center; font-size: 35px; 25; /* Container for flexboxes */ .row 23; display: -webkit-flex; display: flex; 25; /* Create three equal columns that sits next to each other*/ .column23; -webkit-flex: 1; -ms-flex: 1; flex: 1; padding: 10px; height: 300px; /* Should be removed. Only for demonstration */ 25; /* Style the footer */ .footer 23; background-color: #f1f1f1; padding: 10px; text-align: center; 25; /* Responsive layout - makes the three columns stack on top of each other instead of next to each other */ @media (max-width: 600px) 23; .row 23; -webkit-flex-direction: column; flex-direction: column; 25; 25; </style> </head> <body> <h2>CSS Template using Flexbox</h2> <p> In this example, we have created a header, three equal columns and a footer. On smaller screens, the columns will stack on top of each other. </p> <p>Resize the browser window to see the responsive effect.</p> <p> <strong>Note:</strong> Flexbox is not supported in Internet Explorer 10 and earlier versions. </p> <div class="header"> <h2>Header</h2> </div> <div class="row"> <div class="column" style="background-color: #aaa;">Column 1</div> <div class="column" style="background-color: #bbb;">Column 2</div> <div class="column" style="background-color: #ccc;">Column 3</div> </div> <div class="footer"> <p>Footer</p> </div> </body>
<style> * 23; box-sizing: border-box; 25; body 23; font-family: Arial, Helvetica, sans-serif; 25; /* Style the header */ .header 23; grid-area: header; background-color: #f1f1f1; padding: 30px; text-align: center; font-size: 35px; 25; /* The grid container */ .grid-container 23; display: grid; grid-template-areas: 'header header header header header header' 'left left middle middle right right' 'footer footer footer footer footer footer'; /* grid-column-gap: 10px; - if you want gap between the columns */ 25; .left, .middle, .right 23; padding: 10px; height: 300px; /* Should be removed. Only for demonstration */ 25; /* Style the left column */ .left 23; grid-area: left; 25; /* Style the right column */ .middle 23; grid-area: middle; 25; /* Style the right */ .right 23; grid-area: right; 25; /* Style the footer */ .footer 23; grid-area: footer; background-color: #f1f1f1; padding: 10px; text-align: center; 25; /* Responsive layout - makes the three columns stack on top of each other instead of next to each other. */ @media (max-width: 600px) 23; .grid-container 23; grid-template-areas: 'header header header header header header' 'left left left left left left' 'middle middle middle middle middle middle' 'right right right right right right' 'footer footer footer footer footer footer'; 25; 25; </style> </head> <body> <h2>CSS Template using Grid</h2> <p> In this example, we have created a header, three equal columns and a footer. On Smaller screens, the columns will stack on top of each other. </p> <p>Resize the browser window to see the responsive effect.</p> <p> <strong>Note:</strong> The Grid layout Module is not supported in Internet Explorer or Edge 15 and earlier versions. </p> <div class="grid-container"> <div class="header"> <h2>Header</h2> </div> <div class="left" style="background-color: #aaa;">Column 1</div> <div class="middle" style="background-color: #bbb;">Column 2</div> <div class="right" style="background-color: #ccc;">Column 3</div> <div class="footer"> <p>Footer</p> </div> </div> </body>