ex12
HTML/CSS
- ์ผ๋ฐฅ ํ๊ธฐ๋ฒ ๋ง์ด ์ฌ์ฉ
- aaa-bbb-cc
*** CSS์ ๋๋ถ๋ถ์ ์์ฑ์ ๋ชจ๋ ํ๊ทธ์ ์ ์ฉ์ด ๊ฐ๋ฅํ๋ค!!!
๋ฐฐ๊ฒฝ
1. ๋ฐฐ๊ฒฝ์
- background-color
2. ๋ฐฐ๊ฒฝ ์ด๋ฏธ์ง
- background-image
CSS ์์ ํํ๋ฒ
1. Color name: red, yellow, blue..
2. RGB color(HEX): #FF0055
3. RGB color(DEC): rgb(255,0,128)
4. RGBA color(DEC): rgba(255,255,255,1)
a(alpha channel - ๋ถํฌ๋ช
๋(0~1))
body {
/* background-color: yellowgreen; */
/* background-color: rgb(128, 0, 0); */
/* background-color: rgba(0, 0, 255, .5); */
background-image: url(images/cat01.jpg);
/* background-repeat: repeat-x; ํ๋ฐ๋ณต */
/* background-repeat: repeat-y; ์ด๋ฐ๋ณต */
background-repeat: no-repeat;
background-position
์ํ: left|center|right
์์ง: top|center|bottom
์์น(px): ์ ๋์์น
์์น(%): ์๋์์น
background-position: 50% 100px;
/* attachment(๊ธฐ๋ณธ scroll) > fixed(์คํฌ๋กค ๋ด๋ ค๋ ๊ณ ์ ) */
background-attachment: fixed;
/* background-position: center center; */
<html>, <body>
- ๋ธ๋ญ ํ๊ทธ
- ๋ธ๋ญ ํ๊ทธ์ ์์ญ
- ๋๋น: 100%
- ๋์ด: ๋ด์ฉ๋ฌผ๋งํผ
ex13
- ๊ฒ์์ฐฝ style ์ค์
/* ๊ฒ์์ฐฝ์ ์ด๋ฏธ์ง ๋ฃ๊ธฐ */
#search {
background-image: url(images/hangame.png);
background-repeat: no-repeat;
background-position: center center;
}
/* ๊ฒ์์ฐฝ ํด๋ฆญํ๋ฉด ๊ด๊ณ ์ฌ๋ผ์ง */
#search:focus {
background-image: url();
}
/* ๊ฒ์์ฐฝ ํด๋ฆญํ ๋ ํ
๋๋ฆฌ ์ฌ๋ผ์ง */
.data {
outline: none;
}
/* ๊ฒ์์ฐฝ ํด๋ฆญํ์๋ ๋ฐฐ๊ฒฝ์ ์ง์ */
.data:focus {
background-color: yellow;
}
์ ์ฒด์ฝ๋
<!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>
#search {
background-image: url(images/hangame.png);
background-repeat: no-repeat;
background-position: center center;
}
#search:focus {
background-image: url();
}
.data {
outline: none;
}
.data:focus {
background-color: yellow;
}
</style>
</head>
<body>
<!-- ex13_background.html -->
<h1>๋ค์ด๋ฒ</h1>
<input type="text" id="search">
<input type="button" value="๊ฒ์ํ๊ธฐ">
<hr>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
<input type="text" class="data"><br>
</body>
</html>
'ํ๋ก๊ทธ๋๋ฐ ๊ณต๋ถ > HTML&CSS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ex15~17] CSS(box) (2) | 2023.04.14 |
---|---|
[ex14] CSS(text) (0) | 2023.04.14 |
[ex11] CSS(Emmet) (1) | 2023.04.13 |
[ex03~10] CSS (Selector) (0) | 2023.04.13 |
[ex01~02] CSS (Style Sheet) (0) | 2023.04.13 |