CSS - width / height

rabyeoljji·2024년 1월 20일

HTML/CSS (기반쌓기)

목록 보기
8/16
post-thumbnail

⭐ width, height


🗝️point.

  1. 초기값 : auto
    해당 요소가 차지하는 만큼 설정됨

  2. 상속되지 않음


.block {
  width: 300px;
  height: 100px;
  background-color: wheat;
}

.inline {
  width: auto;
  height: auto;
  background-color: yellowgreen;
}

🚨 블록요소는 width와 height 값을 입력하면 그 값에 따라서 크기가 변경이 되지만, 인라인 요소는 콘텐츠가 가지고 있는 크기로 정해져있어 변경이 불가능하다.

profile
⛅🛩️ 먼 길을 돌아서 온 프론트엔드 개발자 ✈️⛅

0개의 댓글