CSS 24 box content의 크기 설정

프론트엔드/CSS|2021. 4. 3. 21:11


<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
  p{
    background-color: yellow; 
    color: red;
    font-weight: bold; 
    font-size: 16pt;
    }
    p.c1{
      width: 700px; 
      height: 80px; 
      color: green;
      }
      p.c2{
        width: 50%; 
        height: 150%; 
        color: purple;
        }
        p.c3{
          width: 10cm; 
          height: 3cm; 
          color: blue;
          }
          </style>
</head>
<body>
  <p>박스모델의 내용영역 크기 지정</p>
  <p class="c1">(1) 박스모델의 크기를 픽셀(px) 단위로 지정</p>
  <p class="c2">(2) 박스모델의 크기를 퍼센트(%) 단위로 지정</p>
  <p class="c3">(3) 박스모델의 크기를 센티미터(cm) 단위로 지정</p>
</body>
</html>

 

'프론트엔드 > CSS' 카테고리의 다른 글

CSS 26 box의 margin과 padding  (0) 2021.04.03
CSS 25 box의 border (경계선)  (1) 2021.04.03
CSS 23 box 모델  (0) 2021.04.03
CSS 22 조합 선택자  (1) 2021.04.03
CSS 21 가상 선택자  (0) 2021.04.03

댓글()
구독