๐ฆ ํ๋ก์ ํธ ๐ป/๐ ํ๋ก์ ํธ
Shadow DOM
output7
2022. 1. 6. 17:43
Shadow DOM
- ๊ฐ๋ฐ์๋๊ตฌ๋ฅผ ์ผ ์ํ์์ F1 ๋ฅผ ๋๋ฅด๋ฉด ํ๊ฒฝ์ค์ ์ด ๋์ด
- Show user agent shadow DOM์ ์ฒดํฌํจ
- ์จ๊ฒจ์ง HTML ์์์ ์คํ์ผ์ ์ค์ ํ ์ ์์
- -webkit- : ํฌ๋กฌ, ์คํ๋ผ, ์ฌํ๋ฆฌ, Edge ๋ธ๋ผ์ฐ์ ์์ ์ฌ์ฉํจ
- -moz- : ํ์ด์ดํญ์ค์์ ์ฌ์ฉํจ
- -ms- : ์ต์คํ๋ก๋ฌ์์ ์ฌ์ฉํจ
- progress ์ค์ ํ ๋ appearance: none์ ํด์ค์ผ ํจ
๋๋ณด๊ธฐ
๋๋ณด๊ธฐ
์ฝ๋
<!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>
/* COMMON */
div {
margin-bottom: 50px;
}
/* LABEL-INPUT */
.labelInput label {
padding: 16px 18px;
font-size: 20px;
font-weight: bold;
text-align: center;
line-height: 59px;
box-sizing: border-box;
color: #fff;
background-color: #2f9e44;
cursor: pointer;
border-radius: 5px;
}
#input-file {
display: none;
}
/* FILE-SHADOWDOM */
.fileShadowDom input[type='file'] {
color: #1864ab;
font-size: 16px;
}
.fileShadowDom input[type='file']::-webkit-file-upload-button {
border: none;
background-color: #1864ab;
padding: 16px 12px;
color: #fff;
font-weight: bold;
border-radius: 5px;
}
/* TEXT-SHADOWDOM */
.textShadowDom input[type='text'] {
padding: 16px 18px;
font-size: 16px;
outline: none;
border: 1px solid #a61e4d;
border-radius: 5px;
}
.textShadowDom input[type='text']::-webkit-input-placeholder {
color: #ffa94d;
font-weight: bold;
}
/* PROGRESS-SHADOWDOM */
.progressShadowDom progress {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
width: 230px;
height: 30px;
}
.progressShadowDom progress::-webkit-progress-bar {
border-radius: 30px;
background-color: #333;
}
.progressShadowDom progress::-webkit-progress-value {
background-color: #ffd43b;
border-top-left-radius: 30px;
border-bottom-left-radius: 30px;
}
</style>
</head>
<body>
<div class="labelInput">
<label for="input-file">์
๋ก๋</label>
<input type="file" id="input-file" />
</div>
<div class="fileShadowDom">
<input type="file" />
</div>
<div class="textShadowDom">
<input type="text" placeholder="์
๋ ฅํ์ธ์" />
</div>
<div class="progressShadowDom">
<progress value="0.7"></progress>
</div>
</body>
</html>