Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- iframe 태그
- 인접 형제 결합자
- 일반 형제 결합자
- 자식결합자
- 임베디드
- width속성
- tag html
- iframe
- 아두이노
- Live Server
- RGB
- css
- Checked 의사 클래스
- sub태그
- go live
- id 선택자
- html
- 전체 선택자
- reveal in file explorer
- height속성
- html 태그
- html tag i
- i 태그
- RGBA
- padding 속성
- sup태그
- not 의사클래스
- background-color 속성
- focus 의사클래스
- br 태그
Archives
- Today
- Total
so woon!
[속성] max-width, max-height, min-width, min-height 본문
학습일 : 2022. 09. 07
max-width 속성
해당 요소의 최대 가로길이를 지정하기 위해 사용한다.
max-height 속성
해당 요소의 최대 세로길이를 지정하기 위해 사용한다.
min-width 속성
해당 요소의 최소 가로길이를 지정하기 위해 사용한다.
min-height 속성
해당 요소의 최소 세로길이를 지정하기 위해 사용한다.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>max-width, max-height, min-width, min-height 속성</title>
<style>
.box {
width: 50vw;
min-width: 20rem;❤
max-width: 40rem;❤
height: 10rem;
background-color: rgb(200, 100, 100);
}
</style>
</head>
<body>
<div class="box"></div>❤
<span id="value" style="font-size: 2rem;">?</span>
<script>
const box = window.document.body.querySelector('.box');
value.innerText = box.getBoundingClientRect().width / 16 + 'rem';
window.addEventListener('resize', () => {
value.innerText = box.getBoundingClientRect().width / 16 + 'rem';
});
</script>
</body>
</html>
============실행결과==============
'CSS > 개념정리' 카테고리의 다른 글
[속성] overflow 속성 (0) | 2022.09.10 |
---|---|
[속성] opacity 속성 (0) | 2022.09.10 |
[속성] font 외 속성 (0) | 2022.09.10 |
[속성] border 외 속성 (0) | 2022.09.10 |
[속성] display 속성 (0) | 2022.09.10 |
Comments