ํผ์์์ input ํ์ radio ๋ฅผ ๋ง๋ค์ด ๋ณด์
checkbox๋ ์ค๋ณต ์ ํ์ด ๊ฐ๋ฅํ๋ฉฐ radio ๋ฒํผ์ ๋จ์ผ ์ ํ๋ง ๊ฐ๋ฅ!
1. html ์์ฑ
๊ฐ๋ก๋ก ๋ฐฐ์นํ ์ ์๋๋ก div wrap์ ์ฌ์ฉํด ๊ทธ๋ฃน์ผ๋ก ๊ฐ์์ค๋ค.
์๊ฐ์ฅ์ ์ธ์ฉ ์น ์ ๊ทผ์ฑ์ ์ํด class๋ช bilnd
๊ธ์๋ฅผ ์ ํํด๋ ์ฒดํฌ ๋ ์ ์๋๋ก label for ์ง์
๊ฐ์ ๊ทธ๋ฃน์ name์ ๊ฐ๊ฒ id๋ช ์ ์์๋๋ก label๊ณผ ๊ผญ ์ผ์นํ๊ฒ ๋ง๋ ๋ค.
<div class="agree_bottom">
<div class="radio_wrap">
<input class="bilnd" id="fruit1" type="radio" name="fruit" checked>
<label for="fruit1">๋ธ๊ธฐ</label>
</div>
<div class="radio_wrap">
<input class="bilnd" id="fruit2" type="radio" name="fruit">
<label class="bilnd" for="fruit2">์ฌ๊ณผ</label>
</div>
<div class="radio_wrap">
<input id="fruit3" type="radio" name="fruit">
<label for="fruit3">๋ฉ๋ก </label>
</div>
</div>
2. ๊ณตํตํด๋์ค ๊ธฐ์กด ๋์์ธ ์ด๊ธฐํ ํด์ฃผ๊ธฐ
/* ํผ์์์ ๋์ด๊ฐ ๋ค๋ฅผ๋ ์์๋ผ๋ฆฌ ์ธ๋ก์ ๋ ฌ์ํด, ios ๋ฅ๊ทผ๋ชจ์๋ฆฌ, ๊ธฐ๋ณธ์คํ์ผ ์ ๊ฑฐ */
/* border-radius:0 -> iOS์์ ํ
๋๋ฆฌ๊ฐ ๋ฅ๊ธ๊ฒ ๋์ค๋ฏ๋ก ๋นผ์ค */
/* -webkit-appearance: none -> iOS์์ ํผ์์์ ๋ด๋ถ๊ทธ๋ฆผ์๊ฐ ๋์ค๋ฏ๋ก ๋นผ์ค */
input, select, textarea, button {
vertical-align: middle;
margin: 0; padding: 0;
border-radius: 0;
-webkit-appearance: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}
๊ทธ๋ผ ๊ธฐ๋ณธ์ผ๋ก ๋ค์ด๊ฐ์๋
๋ผ๋์ค ๋ฐ์ค ๋์์ธ์ด ์ด๊ธฐํ ๋๋ค.
์ฒดํฌ๋ฐ์ค ๋ง๋ค๊ธฐ ์ฐธ๊ณ
https://hyojinny.tistory.com/82
3. ๊ณตํตํด๋์ค๋ก ๊พธ๋ฉฐ์ฃผ๊ธฐ
3-1 ๊ฐ๋ก๋ก ์ข์ฐ์ ๋ ฌ
.radio_wrap { display: inline-block;}
์ธ๋ผ์ธ ๋ธ๋ก์์ ์ข์ฐ ์ํ ๋ค ์ปจํธ๋กค ๊ฐ๋ฅ
3-2 ๊ธ์จ์ ๋ง์ฐ์ค ๊ฐ์ ธ๊ฐ๋ฉด ํฌ์ธํธ ๋ณ๊ฒฝ
3-3 ๊ธ์จ์ ๋ง์ฐ์ค ๊ฐ์ ธ๊ฐ๋ฉด ํฌ์ธํธ ๋ณ๊ฒฝ
๊ธฐ์กด ๋ธ๋ผ์ฐ์ ๋์์ธ ๋์
๋๊ทธ๋ผ๋ฏธ ๋์์ธ์ ๋ณ๊ฒฝํด์ค๋ค.
3-4 ์ฒดํฌํ์๋ ๋ชจ์ ํ์๋ชจ์๋ณ๊ฒฝ
์ฒดํฌํ๋ฉด ํฌ์ธํธ๋ก ๋๊ทธ๋ผ๋ฏธ๊ฐ ์ฒดํฌ๋๊ฒ ํ๋ค.
'HTML๐จ > html&css ํผ์์' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
css ์ด๋ฉ์ผ select option๋ฐ์ค ๋ง๋ค๊ธฐ (0) | 2022.10.10 |
---|---|
css form input type="text" readonly ๋ฌธ์ํ๊ธฐ ๋ง๋ค๊ธฐ (0) | 2022.10.10 |
html form , input ์์ ์ ๋ฆฌ (0) | 2022.10.10 |
html lavel for ํผ ์์์ ์ด๋ฆ์ง์ ํ๊ทธ (0) | 2022.10.09 |
๋ฌธ์์์ฑํ๊ธฐ readonly / input input type="text" ์ ๊ธ์จ ๋ฏธ๋ฆฌ์ ์ฉ (0) | 2022.10.06 |
๋๊ธ