21.11.18-TILμ μ΄μ΄μ§λ λ΄μ©μ λλ€.
Media Query
+ Grid
21.11.16-TILκ³Ό μ΄μ΄μ§λ λ΄μ©μ λλ€.
μμμ λμ΄ μ€μ
- λλλ‘ λμ΄λ μ€μ νμ§ μλλ€.
=> μμ λ΄μ μ½ν μΈ κ° λ³λλ κ°λ₯μ±μ΄ μμΌλ―λ‘ λμ΄ κ°μ μ§μ ν΄ λμΌλ©΄ μ½ν μΈ μ λ³λμ λ°λΌ UIκ° κΉ¨μ§ μ μλ€.
μΈλΌμΈ λ 벨 μμμ
position
/float
μ μ§μ νλ©΄ λΈλ‘ λ λ²¨λ‘ λ°λλ€.
<a href="#none">
μ μλ―Έ
- νμ΄μ§ λ΄μ
id
κ°μ΄none
μΈ κ³³μΌλ‘ μ΄λμ μλ―Έ<a href="#">
μΌ κ²½μ°, νμ΄μ§κ° μλ‘κ³ μΉ¨ λλ―λ‘ μ΄ νμμ λ§κΈ° μν΄<a href="#none">
λ₯Ό μ΄μ©νκΈ°λ νλ€.
=><a href="#none">
μλ μλ―Έκ° μλ κ²μ΄λ―λ‘ λμ ,<a href="javascript:void(0)">
λ₯Ό μ΄μ©νλ κ²λ μ’λ€.
javascript:void(0)
μ μλ―Έ :undefined
λ₯Ό λ°ννλ ν¨μ
λ§ν¬μ μμ± μμ
- μλμ λ°λΌ λ§ν¬μ μμ± μμκ° λ€λ₯Ό μ μλ€.
- μ΄ μ€μ΅μ κ²½μ°,
article.modal-login
μbutton.btn-close
λ₯Ό λ‘κ·ΈμΈ λ²νΌ λ€μ μμ±ν΄μarticle.modal-login
μ°½μ΄ μ΄λ¦° ν ν¬μ»€μ€μ μ΄λμ΄
input[id="inpId"]
>input[id="inpPw"]
>input[type="checkbox"]
>button[class="btn-login"]
>button[class="btn-close"]
μ μμλ‘ μμ§μ΄κ² μμ±
νμ
- νμ΄μ§μ μ½ν μΈ μμ λνλλ μ°½ λλ λνμμ
- νμ μ μ’ ν΄
- μ¬μ©μκ° νμ μ λλ¨Έμ§ λΆλΆκ³Ό μνΈμμ© ν μ μλμ§ μ¬λΆμ λ°λΌ
Modal
: νμ μ λ«κΈ° μ κΉμ§ νμ΄μ§μ μ½ν μΈ λΉνμ±ν
Nonmodal
: νμ μ΄ κ³μ νμλμ΄ μμ΄λ νμ΄μ§ μ½ν μΈ νμ±ν
- λ°°κ²½μ νλ¦Ό μ²λ¦¬(dimmed) μ¬λΆ
ligntbox
: λ°°κ²½μ΄ νλ¦Ό μ²λ¦¬κ° λμ΄μλ κ²½μ°
λ°°κ²½μ΄ νλ¦Ό μ²λ¦¬κ° λμ΄μμ§ μμ κ²½μ°, νΉλ³ν μ΄λ¦μ΄ μλ€.
[μΆμ²: Popups: 10 Problematic Trends and Alternatives]
μ°Έκ³ λ§ν¬
Popups: 10 Problematic Trends and Alternatives
button
μbox-sizing
κΈ°λ³Έ κ°μborder-box
user-select
CSS μμ±
- μ¬μ©μκ° ν μ€νΈλ₯Ό μ νν μ μλμ§ μ¬λΆλ₯Ό μ μ΄
/* Keyword values */ user-select: none; user-select: auto; user-select: text; user-select: contain; user-select: all;
/* Global values */ user-select: inherit; user-select: initial; user-select: revert; user-select: unset;
μμ±κ° μ€λͺ none
ν΄λΉ μμμ νμ μμμ ν μ€νΈλ₯Ό μ νν μ μμ text
ν μ€νΈ μ ν κ°λ₯ μ°Έκ³ λ§ν¬
MDN -user-select
input
, select
λ°μ€input
μμλ select
λ°μ€μ λΈλΌμ°μ μ€νμΌκ³Ό λ€λ₯΄κ² νννκ³€ νλ€.input[type="checkbox"]
컀μ€ν
select
λ°μ€ 컀μ€ν
<!DOCTYPE html>
<html lang="ko">
<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>
<link rel="stylesheet" href="reset.css" />
<style>
h2 {
margin: 30px;
}
.btn-select {
width: 200px;
height: 30px;
background: purple;
color: #fff;
}
.list-member {
display: none;
width: 200px;
height: 30px;
}
.list-member.on {
display: block;
}
.btn-select:active + .list-member {
display: block;
}
.list-member li {
height: 30px;
width: 200px;
}
.list-member li button {
display: block;
height: 100%;
width: 100%;
background-color: #fff;
border: 1px solid black;
border-top: none;
}
.list-member li button:hover {
background-color: bisque;
}
</style>
</head>
<body>
<h2>μ
λ νΈ λ°μ€ λ§λ€κΈ°</h2>
<button class="btn-select">λΉμ μ μμ€ν μ΅μ 맴λ²λ??</button>
<ul class="list-member">
<li><button type="button">카리λ</button></li>
<li><button type="button">μ§μ €</button></li>
<li><button type="button">λλ</button></li>
<li><button type="button">μν°</button></li>
</ul>
<script>
const btn = document.querySelector(".btn-select");
const list = document.querySelector(".list-member");
btn.addEventListener("click", () => {
list.classList.toggle("on");
});
list.addEventListener("click", (event) => {
if (event.target.nodeName === "BUTTON") {
btn.innerText = event.target.innerText;
list.classList.remove("on");
}
});
</script>
</body>
</html>
λμμΈμ μΌλ‘ 보μ΄μ§ μμ§λ§ μ€ν¬λ¦°λ¦¬λλ λΈλΌμ°μ λ₯Ό μν΄ μ 보λ₯Ό μ λ¬νλ ν
μ€νΈλ₯Ό μ¨κΈ°λ λ°©λ²
=> λ€μν λ°©μμ ν΄κ²°μ±
μ΄ μλ€.
/* pcμ© - μ¬μ©λ μ΄λ―Έμ§ λ΄ μλ―Έμλ ν
μ€νΈμ λ체 ν
μ€νΈλ₯Ό μ 곡ν λ */
.ir_pm{
display:block;
overflow:hidden;
Font-size:1px;
line-height:0;
text-indent:-9999px;
}
/* mobileμ© - μ¬μ©λ μ΄λ―Έμ§ λ΄ μλ―Έμλ ν
μ€νΈμ λ체 ν
μ€νΈλ₯Ό μ 곡ν λ */
.ir_pm{
display:block;
overflow:hidden;
font-size:1px;
line-height:0;
color:transparent;
}
/* μ€ν¬λ¦°λ¦¬λκ° μ½μ νμλ μμ§λ§ λ§ν¬μ
ꡬ쑰μ νμν κ²½μ° */
.screen_out {
overflow: hidden;
position: absolute;
width: 0;
height: 0;
line-height: 0;
text-indent: -9999px;
}
/* μ€μν μ΄λ―Έμ§ λ체 ν
μ€νΈλ‘ μ΄λ―Έμ§κ° 보μ΄μ§ μμλ λ체 ν
μ€νΈλ₯Ό 보μ¬μ£Όκ³ μ ν λ */
.ir_wa{
display:block;
overflow:hidden;
position:relative;
z-index:-1;
width:100%;
height:100%
}
.blind {
position: absolute;
clip: rect(0 0 0 0);
width: 1px;
height: 1px;
margin: -1px;
overflow: hidden;
}
λ€κ±°ν°λΈ λ§μ§μ λν λ Όλ
.blind
λΌλ ν΄λμ€ λͺ μ κΆμ₯νμ§ μλλ€.
- bilndμ μλ―Έ
1.λμ΄ λ¨Ό, λ§ΉμΈμΈ
2.λ§ΉμΈλ€
3.λμ΄ λ©κ² λ§λ€λ€, μλ ₯μ μμ κ°λ€ λ±.sr-only
(screen reader only) /.vh
(visually hedden) μ¬μ©νκΈ°
μ½μ΄λ³΄κΈ°