๊ธ๊ผด
- font-family : ์น ๋ฌธ์์ ๊ธ๊ผด์ ์ง์ ํ๋ฉฐ, ์์คํ ๋ด ํฐํธ ์ด๋ฆ ์ค ํ๋๋ฅผ ์ฌ์ฉํ๋ค.
- Web Fonts : ์น ํฐํธ๋ ๋ก์ปฌ์ ํฐํธ ์ค์น ์ํฉ์ ์๊ด์์ด ์น์์ ํญ์ ์ํ๋ ํ์ดํฌ๊ทธ๋ํผ๋ฅผ ์ฌ์ฉํ ์ ์๊ฒ ํ๋ ๊ธฐ์ ์ด๋ค.
- font-size : ํฐํธ์ ํฌ๊ธฐ๋ฅผ ์ง์ ํ๋ค
- font-weight : ํฐํธ์ ๊ตต๊ธฐ๋ฅผ ์ง์ ํ๋ค.
- white-space : ๊ณต๋ฐฑ ์ฒ๋ฆฌ ๋ฐฉ๋ฒ์ ๊ฒฐ์ ํ๋ค
- letter-spacing : ๊ธ์์ ๊ธ์ ์ฌ์ด์ ๊ฐ๊ฒฉ์ ์ง์ ํ๋ค.
- word-spacing : ๋จ์ด์ ๊ฐ๊ฒฉ์ ์กฐ์ ํ๋ค.
- text-overflow : white-space:nowrap; ๋ก ์ง์ ํ์ฌ ํ ์คํธ๊ฐ ์์ญ์ ๋์ณ๋ ์ค ๋ฐ๊ฟ์ด ์ผ์ด๋์ง ์์ ๋ ๋์น๋ ํ ์คํธ๋ฅผ ์ฒ๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ์ง์ ํ๋ค.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
.box {
width: 150px;
height: 150px;
padding: 10px;
margin: 30px;
border: 3px dotted gray;
}
.normal{
white-space: normal;
}
.nowrap{
white-space: nowrap;
}
.pre{
white-space: pre;
}
.pre-wrap{
white-space: pre-wrap;
}
.pre-line{
white-space: pre-line;
}
</style>
</head>
<body>
<h3>white-space : ํด๋น ์์์ ๊ณต๋ฐฑ ์ฒ๋ฆฌ ๋ฐฉ๋ฒ์ ๊ฒฐ์ ํ๋ค.</h3>
<div class="box normal">
<b>normal</b>
javascript html css
java spring
oracle mysql
</div>
<div class="box nowrap">
<b>nowrap</b>
javascript html css
java spring
oracle mysql
</div>
<div class="box pre">
<b>pre</b>
javascript html css
java spring
oracle mysql
</div>
<div class="box pre-wrap">
<b>pre-wrap</b>
javascript html css
java spring
oracle mysql
</div>
<div class="box pre-line">
<b>pre-line</b>
javascript html css
java spring
oracle mysql
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
.box {
width: 150px;
height: 150px;
padding: 10px;
margin: 30px;
border: 3px dotted gray;
}
.ls1{letter-spacing: 3px;}
.ls2{letter-spacing: .2rem;}
.ls3{letter-spacing: -2px;}
</style>
</head>
<body>
<h3>letter-spacing : ๊ธ์์ ๊ธ์์ฌ์ด์ ๊ฐ๊ฒฉ์ ์กฐ์ ํ๋ค.</h3>
<div class="box">
<b>๊ธฐ๋ณธ๊ฐ</b>
javascript html css
java spring
oracle mysql
</div>
<div class="box ls1">
<b>3px</b>
javascript html css
java spring
oracle mysql
</div>
<div class="box ls2">
<b>.2rem</b>
javascript html css
java spring
oracle mysql
</div>
<div class="box ls3">
<b>-2px</b>
javascript html css
java spring
oracle mysql
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
.box {
width: 150px;
height: 150px;
padding: 10px;
margin: 30px;
border: 3px dotted gray;
}
.ws1{word-spacing: 10px;}
.ws2{word-spacing: 130%;}
.ws3{word-spacing: -3px;}
</style>
</head>
<body>
<h3>word-spacing : ๋จ์ด์ ๊ฐ๊ฒฉ์ ์กฐ์ ํ๋ค.</h3>
<div class="box">
<b>๊ธฐ๋ณธ๊ฐ</b>
javascript html css
java spring
oracle mysql
</div>
<div class="box ws1">
<b>10px</b>
javascript html css
java spring
oracle mysql
</div>
<div class="box ws2">
<b>130%</b>
javascript html css
java spring
oracle mysql
</div>
<div class="box ws3">
<b>-3px</b>
javascript html css
java spring
oracle mysql
</div>
</body>
</html>
๋ฐฐ๊ฒฝ
- background-color : ์์์ ๋ฐฐ๊ฒฝ ์์ ์ค์ ํ๋ค. ํ๋์ <color>๊ฐ์ ์ฌ์ฉํด ์ค์ ํ๋ค.
- background-image : ์์์ ๋ฐฐ๊ฒฝ ์ด๋ฏธ์ง๋ฅผ ์ค์ ํ๋ค.
- background-repeat : ๋ฐฐ๊ฒฝ ์ด๋ฏธ์ง๋ฅผ ์ด๋ป๊ฒ ๋ฐ๋ณตํ ์ง ์ค์ ํ๋ค.
- background-position : ๊ฐ ๋ฐฐ๊ฒฝ ์ด๋ฏธ์ง์ ์ด๊ธฐ ์์น๋ฅผ ์ค์ .
- background-size : ์์ ๋ฐฐ๊ฒฝ ์ด๋ฏธ์ง์ ํฌ๊ธฐ๋ฅผ ์ค์ ํ๋ค.
- background-attachment : ๋ฐฐ๊ฒฝ ์ด๋ฏธ์ง์ ์์น๊ฐ ๋ทฐํฌํธ ๋ด์์ ๊ณ ์ ๋๋์ง ๋๋ ํฌํจํ๋ ๋ธ๋ก์ผ๋ก ์คํฌ๋กค ๋๋์ง ์ฌ๋ถ๋ฅผ ์ค์ ํ๋ค.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
.box{
width: 300px;
height: 300px;
padding: 10px;
margin: 30px;
border: 2px dotted gray;
}
.bg1{background-image: url("../img/bg1.png");}
.bg2{background-image: url("../img/bg1.png"); background-repeat: repeat-x;}
.bg3{background-image: url("../img/bg1.png"); background-repeat: no-repeat;}
.bg4{background-image: url("../img/bg1.png"); background-repeat: no-repeat; background-position: right center;}
</style>
</head>
<body>
<h3>background-image</h3>
<div class="box bg1">๋ฐฐ๊ฒฝ์ด๋ฏธ์ง๊ฐ ์ ์ผ๋ฉด ๊ธฐ๋ณธ์ ์ผ๋ก ๋ฐ๋ณตํ๋ค.</div>
<div class="box bg2">x ์ถ ๋ฐ๋ณต</div>
<div class="box bg3">๋ฐ๋ณตํ์ง ์์ผ๋ฉด ์ข์ธก ์ต์๋จ</div>
<div class="box bg4">๋ฐ๋ณตํ์ง ์๊ณ ์ค๋ฅธ์ชฝ ์ค์</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
.box{
width: 300px;
height: 300px;
padding: 10px;
margin: 30px;
border: 2px dotted gray;
}
.bg1{background: url("../img/bg1.png")no-repeat;}
.bg2{background: url("../img/bg1.png")no-repeat, url("../img/bg2.png")}
.bg3{background: url("../img/bg3.png")no-repeat left top,
url("../img/bg3.png")no-repeat right top,
url("../img/bg3.png")no-repeat left bottom,
url("../img/bg3.png")no-repeat right bottom;}
</style>
</head>
<body>
<h3>background</h3>
<div class="box bg1">๋ฐฐ๊ฒฝ์ด๋ฏธ์ง</div>
<div class="box bg2">์ฌ๋ฌ๊ฐ์ ๋ฐฐ๊ฒฝ์ด๋ฏธ์ง๋ฅผ ์ค์ ํ ๊ฒฝ์ฐ ๋จผ์ ์ค์ ํ ์ด๋ฏธ์ง๊ฐ ์ ๋ฉด์ ๋ฐฐ์น</div>
<div class="box bg3">์ฌ๋ฌ๊ฐ์ ๋ฐฐ๊ฒฝ์ด๋ฏธ์ง</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
.box{
width: 600px;
height: 150px;
margin: 30px;
border: 2px dotted gray;
background-image: url("../img/bg4.png");
}
.bg1{background-repeat: no-repeat;}
.bg2{background-size:300px 300px;}
.bg3{background-size: 100% 100%;}
.bg4{background-size: cover;}
.bg5{background-size: contain;}
</style>
</head>
<body>
<h3>background-size</h3>
<div class="box bg1">๋ฐฐ๊ฒฝ์ด๋ฏธ์ง</div>
<div class="box bg2">์ง์ ๋ px๊ฐ ๊ทธ๋๋ก ์ค์ </div>
<div class="box bg3">์ง์ ๋ %๊ฐ์ ๋น๋กํ์ฌ ์ค์ . ํ๋ฉด์ ์ค์ด๊ฑฐ๋ ๋๋ฆฌ๋ฉด ๋ฐฐ๊ฒฝ์ด๋ฏธ์ง์ ํฌ๊ธฐ๋ ๋ฐ๋ผ์ ๋ณ๊ฒฝ๋์ด ์ฐ๊ทธ๋ฌ์ง๋ ํ์์ด ๋ํ๋๋ค.</div>
<div class="box bg4">๋ฐฐ๊ฒฝ์ด๋ฏธ์ง์ ํฌ๊ธฐ ๋น์จ์ ์ ์งํ ์ํ์์ ๋ถ๋ชจ ์์์ width, height ์ค ํฐ๊ฐ์ ๋ฐฐ๊ฒฝ์ด๋ฏธ์ง๋ฅผ ๋ง์ถ๋ค. ๋ฐ๋ผ์ ์ด๋ฏธ์ง์ ์ผ๋ถ๊ฐ ๋ณด์ด์ง ์์ ์ ์๋ค.</div>
<div class="box bg5">๋ฐฐ๊ฒฝ์ด๋ฏธ์ง์ ํฌ๊ธฐ ๋น์จ์ ์ ์งํ ์ํ์์ ๋ถ๋ชจ ์์์ ์์ญ์ ๋ฐฐ๊ฒฝ์ด๋ฏธ์ง๊ฐ ๋ณด์ด์ง ์๋ ๋ถ๋ถ์์ด ์ ์ฒด๊ฐ ๋ค์ด๊ฐ ์ ์๋๋ก ์ด๋ฏธ์ง ์ค์ผ์ผ์ ์กฐ์ ํ๋ค. ๋์ด๋ฅผ 150์ผ๋ก ๋ณ๊ฒฝํ๋ฉด ํ์ธ ๊ฐ๋ฅ</div>
</body>
</html>
'๐ป > CSS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
(45) [CSS] 3์ผ ๋ฐ์ํ ์น(Responsive Web) (1) | 2024.04.18 |
---|---|
(45) [CSS] 3์ผ ๋ ์ด์์๊ณผ ํฌ์ง์ ๋ - Grid (0) | 2024.04.18 |
(44) [CSS] 2์ผ ๋ ์ด์์๊ณผ ํฌ์ง์ ๋ - flex (0) | 2024.04.17 |
(44) [CSS] 2์ผ ๋ ์ด์์๊ณผ ํฌ์ง์ ๋ (0) | 2024.04.17 |
(43) [CSS] 1์ผ CSS ๊ธฐ์ด (0) | 2024.04.16 |