๐Ÿ’ป Programming/CSS (28)

CSS position ์†์„ฑ ์ •๋ณตํ•˜๊ธฐ

 

์•ˆ๋…•ํ•˜์„ธ์š”, ์˜ค๋Š˜์€ ์ž๊พธ ํ—ท๊ฐˆ๋ฆฌ๊ฒŒ ๋งŒ๋“œ๋Š” ํฌ์ง€์…˜ ์†์„ฑ์— ๋Œ€ํ•ด์„œ ํฌ์ŠคํŒ…์„ ํ•˜๋ คํ•ฉ๋‹ˆ๋‹ค.

 

ํ”„๋ก ํŠธ ๊ฐœ๋ฐœ์ž๊ฐ€ ์•„๋‹ˆ๋‹ค๋ณด๋‹ˆ ์ข…์ข… css ๋ฅผ ์‚ฌ์šฉํ•˜๊ฒŒ ๋ ๋•Œ๋งˆ๋‹ค ์ œ์ผ ํ—ท๊ฐˆ๋ฆฌ๋Š”๊ฒŒ ๋ฐ”๋กœ ์ด ํฌ์ง€์…˜ ์†์„ฑ์ž…๋‹ˆ๋‹ค.

 

ํฌ์ง€์…˜ ์†์„ฑ์€ ํ™”๋ฉด์ƒ์—์„œ ์–ด๋–ค ์—˜๋ฆฌ๋จผํŠธ(์š”์†Œ)์˜ ์œ„์น˜๋ฅผ ์–ด๋””๋‹ค๊ฐ€ ์ค„์ง€๋ฅผ ๊ฒฐ์ •ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์ฃผ๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค.

 

์ฆ‰, ํฌ์ง€์…”๋‹์„ ํ•  ๋ฐฉ๋ฒ•์„ ์ง€์ •ํ•ด์ฃผ๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค.

 

ํ™”๋ฉด์„ ๊พธ๋ฐ€ ๋•Œ htmlํŒŒ์ผ์— ํƒœ๊ทธ๋ฅผ ์จ์ฃผ๋Š”๋ฐ ์ด๋•Œ ์ ํžŒ ์ˆœ์„œ๋Œ€๋กœ ์œ„์—์„œ ์•„๋ž˜๋กœ ๊ทธ๋ƒฅ ๋ณด์—ฌ์ค„ ์ง€, ์•„๋‹ˆ๋ฉด ์ƒ์œ„ ์—˜๋ฆฌ๋จผํŠธ์™€ ๊ฒน์ณ์„œ ๋ณด์—ฌ์ค„ ์ง€, ๋˜๋Š” ์•„์˜ˆ ๋™๋–จ์–ด์ ธ์„œ ์ €~~~~~์•„๋ž˜์ชฝ์— ์œ„์น˜์‹œํ‚ฌ์ง€๋„ ๊ฒฐ์ •์„ ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์ค๋‹ˆ๋‹ค.

 

์ง์ ‘์ ์œผ๋กœ ์œ„์น˜๊ฐ’์„ ์ง€์ •ํ•ด์ฃผ๋Š” ์†์„ฑ์€ ์•„๋‹ˆ์ง€๋งŒ ์ด ์†์„ฑ๊ฐ’์— ๋”ฐ๋ผ ์œ„์น˜๊ฐ’์ด ์ ์šฉ์ด ๋ ์ง€ ์•ˆ๋ ์ง€๊ฐ€ ๊ฒฐ์ •๋˜๊ธฐ ๋•Œ๋ฌธ์— ์•„์ฃผ ์ค‘์š”ํ•œ ์†์„ฑ์ด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์ž, ๊ทธ๋Ÿผ ์ด ํฌ์ง€์…˜ ์†์„ฑ์˜ ์†์„ฑ๊ฐ’์— ์–ด๋–ค ๊ฒƒ๋“ค์ด ์žˆ๋Š”์ง€ ๋จผ์ € ์‚ดํŽด๋ณผ๊นŒ์š”?

 

ํฌ์ง€์…˜ ์†์„ฑ์˜ ์†์„ฑ๊ฐ’์€ ๋‹ค์Œ ๋„ค ๊ฐ€์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

  • static
  • relative
  • fixed
  • absolute

์ด๋Ÿฐ ์†์„ฑ์„ ๊ฐ–๋Š” ์—˜๋ฆฌ๋จผํŠธ๋“ค์€ ๋ถ€์ˆ˜์ ์œผ๋กœ top, bottom, left, ๊ทธ๋ฆฌ๊ณ  right ์†์„ฑ์„ ๊ฐ–๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

 

๋ฌผ๋ก  ๋ถ€์ˆ˜์ ์ธ ๊ฐ’๋“ค์„ ์ฃผ์ง€ ์•Š์„ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. 

 

์–ด์จŒ๋“  ์ด๋Ÿฐ ๋ถ€์ˆ˜์ ์ธ ์œ„์น˜๊ฐ’๋“ค์€ position ์†์„ฑ์ด ์—†์œผ๋ฉด ์•„๋ฌด๋Ÿฐ ์˜ํ–ฅ๋„ ๋ฏธ์น˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. 

 

๋˜ํ•œ ํฌ์ง€์…˜ ๊ฐ’์— ๋”ฐ๋ผ ๋‹ค๋ฅด๊ฒŒ ๋™์ž‘ํ•˜๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค.

 

๊ทธ๋Ÿผ ์ œ์ผ ์ฒซ๋ฒˆ์งธ ์†์„ฑ๋ถ€ํ„ฐ ํ•œ๋ฒˆ ์‚ดํŽด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

1. static 

 

static ์†์„ฑ์€ ๊ถ‚์ด ์šฐ๋ฆฌ๊ฐ€ ์ž…๋ ฅํ•ด์ฃผ์ง€ ์•Š์•„๋„ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ ์šฉ์ด ๋˜์–ด์žˆ๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค.

 

์˜ˆ๋ฅผ ๋“ค์–ด, ์•„๋ž˜ ์ฒ˜๋Ÿผ div ํƒœ๊ทธ์— position ์†์„ฑ์„ ์ฃผ์ง€ ์•Š์•˜๋‹ค๊ณ  ํ•ด๋ณด์ฃ .

 

<div>์ด๊ฑด static ํฌ์ง€์…˜ ์†์„ฑ์ด ์ ์šฉ๋œ๊ฒ๋‹ˆ๋‹ค.</div>

 

์•„๋ฌด๋Ÿฐ ๊ฐ’๋„ ์ฃผ์ง€ ์•Š์•˜์ง€๋งŒ ์ € div ํƒœ๊ทธ์—๋Š” position:static ์ด๋ผ๋Š” ์†์„ฑ์ด ๊ธฐ๋ณธ์ ์œผ๋กœ ์ฃผ์–ด์ง‘๋‹ˆ๋‹ค. ์ฆ‰,

 

<div style="position:static;">์ด๊ฑด static ํฌ์ง€์…˜ ์†์„ฑ์ด ์ ์šฉ๋œ๊ฒ๋‹ˆ๋‹ค.</div>

 

์™€ ๋™์ผํ•œ ํƒœ๊ทธ๊ฐ€ ๋˜๋Š” ๊ฒƒ์ด์ฃ .

 

static ์†์„ฑ์€ ์—˜๋ฆฌ๋จผํŠธ๋ฅผ ์œ„์—์„œ๋ถ€ํ„ฐ ์•„๋ž˜์ชฝ์œผ๋กœ ์ˆœ์„œ๋Œ€๋กœ ๋ฐฐ์—ด์‹œ์ผœ์ฃผ๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค.

 

๋„ค ๊ฐ€์ง€ ์†์„ฑ ์ค‘์—์„œ ์œ ์ผํ•˜๊ฒŒ top, right, bottom, left ์†์„ฑ์˜ ๊ฐ’์„ ๋ฌด์‹œํ•˜๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค.

 

 

2. relative

 

 position: relative; ์†์„ฑ์„ ๊ฐ–๋Š” ์—˜๋ฆฌ๋จผํŠธ๋“ค์€ ์›๋ž˜ ๊ธฐ๋ณธ์ ์ธ ํฌ์ง€์…˜์—์„œ ์ƒ๋Œ€์ ์ธ ํฌ์ง€์…˜์„ ๊ฐ€์งˆ ์ˆ˜ ์žˆ๋„๋ก ํ•ด์ค๋‹ˆ๋‹ค.

 

์œ„์—์„œ ์–˜๊ธฐํ–ˆ๋˜ ๋ถ€์ˆ˜์ ์ธ ์˜ต์…˜๋“ค(top, right, bottom, ๊ทธ๋ฆฌ๊ณ  left)์„ ์ด์šฉํ•ด์„œ ์›๋ž˜์˜ ์œ„์น˜์—์„œ ์ƒ๋Œ€์ ์ธ ์œ„์น˜๋ฅผ ์ง€์ •ํ•ด์ค„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. 

 

์—ฌ๊ธฐ์„œ ๋งํ•˜๋Š” "์›๋ž˜์˜ ์œ„์น˜"๋ผ๋Š” ๊ฒƒ์€  position์†์„ฑ์— ์•„๋ฌด๋Ÿฐ ๊ฐ’์„ ์ฃผ์ง€ ์•Š์•˜์„ ๋•Œ, ์ฆ‰, static ์ผ๋•Œ์˜ ์œ„์น˜๋ฅผ ๋งํ•ฉ๋‹ˆ๋‹ค. 

 

๋˜ํ•œ, ๋‹ค๋ฅธ ์ปจํ…ํŠธ๊ฐ€ ์ด ์—˜๋ฆฌ๋จผํŠธ์— ์˜ํ•ด ์ƒ๊ธด ๋นˆ ๊ณต๊ฐ„์— ์œ„์น˜ํ•  ์ˆ˜๋Š” ์—†์Šต๋‹ˆ๋‹ค.

 

๋นˆ๊ณต๊ฐ„์ด๋ž€ ์›๋ž˜ ์œ„์น˜ํ•ด์•ผํ•  ๊ณณ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค.

 

relative ์†์„ฑ๊ณผ static ์†์„ฑ์˜ ์ฐจ์ด๋Š” 

static ์†์„ฑ์˜ ๊ฒฝ์šฐ top, right, bottom, left ์†์„ฑ์œผ๋กœ ์œ„์น˜๋ฅผ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์—†์ง€๋งŒ, 

relative๋Š” ๊ทธ๊ฒƒ์ด ๊ฐ€๋Šฅํ•˜๋‹ค๋ผ๋Š” ์ ์ž…๋‹ˆ๋‹ค. 

 

์˜ˆ์ œ๋ฅผ ํ†ตํ•ด์„œ static๊ณผ relative์˜ ์ฐจ์ด๋ฅผ ํ•œ๋ฒˆ ๋ณผ ๊นŒ์š”??

 

htmlํŒŒ์ผ์„ ํ•˜๋‚˜ ๋งŒ๋“ค์–ด์„œ ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”.

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<html>
<head>
<style>
div.static {position: static;border: 3px solid #00f;}
div.relative {position: relative;border: 3px solid #f00;}
</style>
</head>
<body>
 
<div class="static">
This div element has position: static;
</div>
<div class="relative">
This div element has position: relative;
</div>
<div class="static">
This div element has position: static;
</div>
<div class="relative">
This div element has position: relative;
</div>
 
</body>
</html>
cs
 

์œ„ ํŽ˜์ด์ง€๋ฅผ ์—ด์–ด๋ณด๋ฉด ์•„๋ž˜์ฒ˜๋Ÿผ ํ™”๋ฉด์— ์ถœ๋ ฅ์ด ๋ฉ๋‹ˆ๋‹ค. 

 

์ž, ์ฝ”๋“œ๋ฅผ ๋ณด๋ฉด static ํด๋ž˜์Šค์™€ relative ํด๋ž˜์Šค ๋ชจ๋‘ ๋™์ผํ•œ ์†์„ฑ์„ ๊ฐ–๊ณ ์žˆ๋Š” ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ์ฃ . top, right, bottom, left์˜ ๊ฐ’์€ ๋‘˜ ๋‹ค ์—†์Šต๋‹ˆ๋‹ค. ์ด ๊ฒฝ์šฐ relative์™€ static์€ ์•„๋ฌด๋Ÿฐ ์ฐจ์ด๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. ๊ทธ์ €, ํƒœ๊ทธ ์ˆœ์„œ๋Œ€๋กœ ํ™”๋ฉด์— ์ถœ๋ ฅ๋˜์ฃ .

 

์ด์ œ static ํด๋ž˜์Šค์˜ ์†์„ฑ์— left:15px ์„ ํ•œ๋ฒˆ ์ค˜๋ณผ๊นŒ์š”?

 

1
2
3
4
<style>
div.static {position: static;border: 3px solid #00f;left: 15px;}
div.relative {position: relative;border: 3px solid #f00;}
</style>
cs

 

๊ฒฐ๊ณผ๊ฐ€ ์–ด๋–ป๊ฒŒ ๋‚˜์˜ฌ๊นŒ์š”?

 

์•„๋ฌด๋Ÿฐ ์ฐจ์ด๊ฐ€ ์—†์„ ๊ฒ๋‹ˆ๋‹ค. static์€ top, right, bottom, left ์†์„ฑ๊ฐ’์„ ๋ฌด์‹œํ•˜๊ธฐ ๋•Œ๋ฌธ์ด์ฃ .

 

๊ทธ๋Ÿผ ์ด๋ฒˆ์—๋Š” relative์— left:15px; ์†์„ฑ์„ ์ค˜ ๋ด…์‹œ๋‹ค.

 

 

1
2
3
4
<style>
div.static {position: static;border: 3px solid #00f;}
div.relative {position: relative;border: 3px solid #f00;left: 15px;}
 
</style>
cs

 

 

์ด๋ฒˆ์—๋Š” ์•„๋ž˜ ๊ทธ๋ฆผ์ฒ˜๋Ÿผ relative ํด๋ž˜์Šค์— ํ•ด๋‹นํ•˜๋Š” div ์—˜๋ฆฌ๋จผํŠธ๊ฐ€ ์›€์ง์ธ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

 

 

์ด์ œ ์•„๋ž˜์ฒ˜๋Ÿผ relativeํด๋ž˜์Šค์— top:15px; ์†์„ฑ์„ ์ถ”๊ฐ€ํ•ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

 

 

1
2
3
4
<style>
div.static {position: static;border: 3px solid #00f;}
div.relative {position: relative;border: 3px solid #f00;left: 15px;top: 15px;}
 
</style>
cs

 

๊ทธ๋Ÿผ ์–ด๋–ป๊ฒŒ ๋‚˜์˜ฌ์ง€ ์ƒ์ƒ์ด ๊ฐ€์‹œ๋‚˜์š”?

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์ฒ˜๋Ÿผ ๋‚˜์˜ต๋‹ˆ๋‹ค.

 

 

 

relative ํด๋ž˜์Šค์— ์†ํ•œ div ์—˜๋ฆฌ๋จผํŠธ๋“ค์ด ์•„๋ž˜์ชฝ์œผ๋กœ 15px๋งŒํผ ๋‚ด๋ ค์˜จ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์ด์ œ top์†์„ฑ์˜ ๊ฐ’์„ 100px๋กœ ์„ธํŒ…ํ•ด๋ณด์„ธ์š”. relative ํด๋ž˜์Šค์˜ div ์—˜๋ฆฌ๋จผํŠธ๋“ค์ด ์•„๋ž˜์ชฝ์œผ๋กœ ํ•œ์ฐธ ๋‚ด๋ ค๊ฐ€๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ ์ค‘์š”ํ•œ ์ ์€, relative ํด๋ž˜์Šค์˜ ์—˜๋ฆฌ๋จผํŠธ๋“ค์ด ์•„๋ž˜๋กœ ๋‚ด๋ ค๊ฐ”๋‹ค๊ณ  ํ•ด์„œ static ํด๋ž˜์Šค์˜ ์—˜๋ฆฌ๋จผํŠธ๋“ค์ด ์œ„์ชฝ์œผ๋กœ ์ด๋™ํ•˜๊ฑฐ๋‚˜ ํ•˜์ง€๋Š” ์•Š๋Š” ๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

 

 

3. fixed

 

fixed ์†์„ฑ์€ ํ™”๋ฉด์— ๋ณด์ด๋Š” ์œ„์น˜๊ฐ€ ๊ธฐ์ค€์ด๋ผ๊ณ  ์ƒ๊ฐํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. 

 

ํ•œ๋ฒˆ ์œ„์น˜๊ฐ€ ๊ฒฐ์ •๋˜๋ฉด ํ™”๋ฉด์—์„œ ์Šคํฌ๋กค์ด ์ƒ๊ธด๋‹คํ•ด๋„ ์‚ฌ๋ผ์ง€์ง€ ์•Š๊ณ  ์ฒ˜์Œ ํ™”๋ฉด์— ์ถœ๋ ฅ๋˜์—ˆ๋˜ ๊ทธ์ž๋ฆฌ์— ๊ณ ์ •์ ์œผ๋กœ ์œ„์น˜ํ•ฉ๋‹ˆ๋‹ค. 

 

๊ทธ๋ž˜์„œ ์†์„ฑ ์ด๋ฆ„์ด fixed ์ธ๊ฒ๋‹ˆ๋‹ค. 

 

์ด ์†์„ฑ์˜ ๊ฒฝ์šฐ relative์ฒ˜๋Ÿผ top, right, bottom, left ์†์„ฑ์œผ๋กœ ์œ„์น˜๊ฐ’์„ ์ง€์ •ํ•ด์ค„ ์ˆ˜ ์žˆ์ง€๋งŒ, 

relative ์†์„ฑ๊ณผ๋Š” ๋‹ฌ๋ฆฌ ์›๋ž˜ ์žˆ์–ด์•ผ ํ•  ์œ„์น˜, ์ฆ‰, static์ผ ๊ฒฝ์šฐ์— ์œ„์น˜ํ•  ๊ณณ์— ๋นˆ๊ณต๊ฐ„์„ ๋งŒ๋“ค์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

 

์—ฌ๊ธฐ์„œ ๋นˆ๊ณต๊ฐ„์„ ๋งŒ๋“ ๋‹ค๋Š” ๊ฒƒ์€ ๋‹ค๋ฅธ ์—˜๋ฆฌ๋จผํŠธ๊ฐ€ ๊ทธ ์ž๋ฆฌ์— ์œ„์น˜ํ•  ์ˆ˜ ์—†๋„๋ก ํ•œ๋‹ค๋Š” ๋ง๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

์ด ์†์„ฑ์€ ๋ง ๊ทธ๋Œ€๋กœ ํ™”๋ฉด์„ ๊ธฐ์ค€์œผ๋กœ ์–ด์ฐŒ๋ณด๋ฉด ์ ˆ๋Œ€์ ์ธ ์œ„์น˜๋ฅผ ์„ค์ •ํ•˜๋Š” ๊ฒƒ์ด๋ฏ€๋กœ ์•„๋งˆ ๊ฐ€์žฅ ์‰ฝ๊ฒŒ ์ดํ•ดํ•  ์ˆ˜ ์žˆ๋Š” ์†์„ฑ์ด๋ผ ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์˜ˆ์ œ๋Š” ์ƒ๋žตํ•ฉ๋‹ˆ๋‹ค.

 

 

4. absolute

 

์ด ์†์„ฑ์€ ๊ฐ€์žฅ ๊ฐ€๊นŒ์šด positioned ์กฐ์ƒ ์—˜๋ฆฌ๋จผํŠธ์— ์ƒ๋Œ€์ ์ธ ์œ„์น˜๋ฅผ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์ค๋‹ˆ๋‹ค.

 

fixed ์†์„ฑ์ด ํ™”๋ฉด์—์„œ ์ƒ๋Œ€์ ์ธ ์œ„์น˜๋ฅผ ๊ฒฐ์ •ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์ฃผ๋Š” ์†์„ฑ์ด๋ผ๋ฉด,

 

absolute๋Š” positioned ์กฐ์ƒ ์—˜๋ฆฌ๋จผํŠธ์—์„œ ์ƒ๋Œ€์ ์ธ ์œ„์น˜๋ฅผ ๊ฒฐ์ •ํ•œ๋‹ค๋Š” ์ ์—์„œ ์ฐจ์ด๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

 

๋งŒ์•ฝ, ๊ฐ€์žฅ ๊ฐ€๊นŒ์šด positioned ์กฐ์ƒ ์—˜๋ฆฌ๋จผํŠธ ๊ฐ€ ์—†๋‹ค๋ฉด body๋ฅผ ๊ธฐ์ค€์œผ๋กœ ํ•˜๋ฉฐ ์œ„์น˜๊ฐ’์— ๋”ฐ๋ผ ์Šคํฌ๋กค์ด ์ƒ๊ธฐ๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค.

 

์—ฌ๊ธฐ์„œ, positioned ์—˜๋ฆฌ๋จผํŠธ๋ผ๋Š” ๊ฒƒ์€ position ์†์„ฑ ๊ฐ’์ด static์ธ ๊ฒƒ์„ ์ œ์™ธํ•˜๊ณ  position ์†์„ฑ์„ ๊ฐ–๊ณ ์žˆ๋Š” ์—˜๋ฆฌ๋จผํŠธ๋ฅผ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค.

 

์ด ์†์„ฑ์€ ์‡ผํ•‘๋ชฐ ๊ฐ™์€ ๊ณณ์—์„œ ์‚ฌ์ง„ ์œ„์— ์™ผ์ชฝ, ์˜ค๋ฅธ์ชฝ ํ™”์‚ดํ‘œ๋ฅผ ์˜ค๋ฒ„๋žฉ ์‹œํ‚ค๊ณ  ํ•ด๋‹น ํ™”์‚ดํ‘œ๋ฅผ ํด๋ฆญํ•  ๋•Œ๋งˆ๋‹ค ์‚ฌ์ง„์„ ๋ฐ”๊ฟ”์ฃผ๋Š” ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•  ๋•Œ ๋งŽ์ด ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

๊ทธ๊ฒŒ ์–ด๋–ป๊ฒŒ ๊ฐ€๋Šฅํ•˜๋ƒ๊ตฌ์š”? ์ด์ œ๋ถ€ํ„ฐ ์ €์™€ ํ•จ๊ป˜ ์‚ดํŽด๋ณด์‹œ์ฃ .

 

์šฐ์„   html ํŽ˜์ด์ง€๋ฅผ ํ•˜๋‚˜ ๋งŒ๋“ค๊ณ  ์•„๋ž˜์ฒ˜๋Ÿผ ์†Œ์Šค๋ฅผ ์ ์–ด์ฃผ์„ธ์š”.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE html>
<html>
<head>
<style>
div.relative {width: 360px;height: 200px;border: 3px solid #00f;position: relative;}
div.absolute {width: 200px;height: 100px;border: 3px solid #f00;position: absolute;}
</style>
</head>
<body>
 
<div class="relative">position: relative;
  <div class="absolute">position: absolute;</div>
</div>
 
</body>
</html>
cs

 

์œ„ ์ฝ”๋“œ๋ฅผ ๋ณด๋ฉด, relative ํด๋ž˜์Šค์˜ div ์—˜๋ฆฌ๋จผํŠธ ์•ˆ์— absolute ํด๋ž˜์Šค์˜ div ์—˜๋ฆฌ๋จผํŠธ๊ฐ€ ์กด์žฌํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

 

absolute ํฌ์ง€์…”๋‹์€ ์ƒ์œ„์— positioned ์—˜๋ฆฌ๋จผํŠธ๊ฐ€ ํ•„์š”ํ•˜๋‹ค๋Š” ๊ฒƒ์„ ๊ธฐ์–ตํ•ด์ฃผ์„ธ์š”.

 

์—ฌ๊ธฐ์„œ absolute ํด๋ž˜์Šค div ์—˜๋ฆฌ๋จผํŠธ(12๋ผ์ธ)์˜ positioned ์กฐ์ƒ ์—˜๋ฆฌ๋จผํŠธ๋Š” relative ํด๋ž˜์Šค div ์—˜๋ฆฌ๋จผํŠธ(11๋ผ์ธ)๊ฐ€ ๋ฉ๋‹ˆ๋‹ค.

 

์œ„ ์ฝ”๋“œ๋ฅผ ํ™”๋ฉด์— ์ถœ๋ ฅํ•ด๋ณด๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

absolute ๋ฐ•์Šค๊ฐ€ relative ๋ฐ•์Šค ์•ˆ์— ์žˆ๋Š” ๋ชจ์–‘์ด์ฃ .

 

์ด์ œ absolute์— right:0; ์†์„ฑ์„ ์ถ”๊ฐ€ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

1
2
3
4
<style>
div.relative {width: 360px;height: 200px;border: 3px solid #00f;position: relative;}
 
div.absolute {width: 200px;height: 100px;border: 3px solid #f00;position: absolute;right:0;}
</style>
cs

 

๊ทธ๋ฆฌ๊ณ  ํ™”๋ฉด์„ ์ƒˆ๋กœ๊ณ ์นจ ํ•ด๋ณด๋ฉด ???

 

absolute ๋ฐ•์Šค๊ฐ€ ์˜ค๋ฅธ์ชฝ์œผ๋กœ ๋ถ™์€ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

 

์ด์ œ relative ํด๋ž˜์Šค์— left:150px; ์†์„ฑ์„ ์ถ”๊ฐ€ํ•ด ๋ณด์ฃ .

 

1
2
3
4
<style>
div.relative {width:360px;height:200px;border:3px solid #00f;position:relative;left:150px;}
 
div.absolute {width:200px;height:100px;border:3px solid #f00;position:absolute;right:0;}
</style>
cs

 

์–ด๋–ค ๋ชจ์–‘์ด ๋‚˜์˜ฌ๊นŒ์š”? absolute ๋ฐ•์Šค๋Š” relative ๋ฐ•์Šค ์•ˆ์— ์žˆ๋Š”๋ฐ relative ๋ฐ•์Šค๋ฅผ ์šฐ์ธก์œผ๋กœ ์›€์ง์˜€์Šต๋‹ˆ๋‹ค.

 

relative ๋ฐ•์Šค์˜ ์ขŒ์ธก์— 150px๋งŒํผ ๊ณต๊ฐ„์„ ์ถ”๊ฐ€ํ–ˆ๊ณ , ๊ทธ ์•ˆ์—์žˆ๋Š” absolute ๋ฐ•์Šค๋Š” relative ๋ฐ•์Šค ์˜ค๋ฅธ์ชฝ์— ๊ผญ ๋ถ™์–ด์žˆ๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์ฆ‰, absolute ๋ฐ•์Šค๋Š” relative ๋ฐ•์Šค์— ์ƒ๋Œ€์ ์ธ ์œ„์น˜์— ๊ณ ์ •๋œ๋‹ค๋Š” ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ์ฃ .

 

์ด ์†์„ฑ์„ ์‘์šฉํ•˜๋ฉด relative ๋ฐ•์Šค์— ์ด๋ฏธ์ง€๊ฐ€ ๋กœ๋”ฉ ๋˜๋„๋ก ํ•˜๊ณ , absolute ๋ฐ•์Šค์— ํ™”์‚ดํ‘œ ์ด๋ฏธ์ง€๊ฐ€ ๋กœ๋”ฉ๋˜๋„๋ก ํ•ด์„œ ๋‘ ๊ฐœ์˜ ์ด๋ฏธ์ง€๋ฅผ ์˜ค๋ฒ„๋ž˜ํ•‘ ์‹œํ‚ฌ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์ด๊ฑด ์ง์ ‘ ํ•œ๋ฒˆ ํ•ด๋ณด์„ธ์š” ~~

 

 

 

 

์ž, ์–ด๋–ค๊ฐ€์š”? ์ด์ œ CSS๋ฅผ ์ด์šฉํ•œ ํฌ์ง€์…”๋‹์„ ๋งˆ์Œ๋Œ€๋กœ ํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™๋‚˜์š”?

 

๊ทธ๋ ‡๋‹ค๋ฉด ๋‹คํ–‰์ด๋„ค์š”~ ^-^ ์ œ๊ฐ€ ์„ค๋ช…์„ ์ž˜ ํ•ด๋“œ๋ฆฐ ๊ฒƒ์ด๋‹ˆ๊นŒ์š” ใ…Žใ…Žใ…Ž

 

์ด๋งŒ ์˜ค๋Š˜์˜ ํฌ์ŠคํŒ…์„ ๋งˆ์น˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

๊ถ๊ธˆํ•œ ์ ์ด ์žˆ์œผ์‹œ๋ฉด ๋Œ“๊ธ€๋‚จ๊ฒจ์ฃผ์„ธ์š” ์•„๋Š” ํ•œ ์—ด์‹ฌํžˆ ๋‹ต๋ณ€๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค ^-^

 

 

์›นํŽ˜์ด์ง€๋ฅผ ๋””์ž์ธํ•˜๋‹ค๋ณด๋ฉด ๊ตฌ์—ญ์„ ๋‚˜๋ˆ ์„œ ์ •๋ณด๋ฅผ ํ‘œ์‹œํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

CSS์—์„œ๋Š” ์ด๋ ‡๊ฒŒ ๊ตฌ์—ญ์„ ๋‚˜๋ˆˆ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์—ฌ์ง€๋„๋ก ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์‹ค์ œ๋กœ ํ…Œ์ด๋ธ”์ด๋‚˜ frame์œผ๋กœ ๋‚˜๋ˆˆ๊ฒƒ์€ ์•„๋‹ˆ๊ณ  ๊ทธ๋ƒฅ ๊ทธ๋ ‡๊ฒŒ ๋ณด์ด๊ฒŒ๋” ํ•˜๋Š” ๊ฑฐ์ฃ .


CSS also provides table-layout property to make your tables load much faster.Following is the example:

<table style="table-layout:fixed;width:600px;">
  <tr height="30">
    <td width="150">CSS table layout cell 1</td>
    <td width="200">CSS table layout cell 2</td>
    <td width="250">CSS table layout cell 3</td>
  </tr>
</table>

You will notice the benefits more on large tables. The reason this makes tables load faster is because with traditional HTML, the browser had to calculate every cell before finally rendering the table. When you set the table-layout algorithm to fixed however, it only needs to look at the first row before rendering the whole table. This means that your table will need to have fixed column widths and row heights.

Sample Column Layout:

CSS๋ฅผ ์ด์šฉํ•ด์„œ ๊ฐ„๋‹จํ•œ Column Layout ์„ ๋งŒ๋“ค์–ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

์šฐ์„  ๋ฌธ์„œ ์ „์ฒด์˜ ๋งˆ์ง„๊ณผ ํŒจ๋”ฉ, ๋ฐฑ๊ทธ๋ผ์šด๋“œ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

<style tyle="text/css">
<!--
body {
    margin:9px 9px 0 9px;
    padding:0;
    background:#FFF;
}
-->
</style>


Now we will define a column with yellow color and later we will attach this rule to a <div>:

<style tyle="text/css">
<!--
#level0 {
     background:#FC0;
}
-->
</style>


Up to this point we will have a document with yellow body, so lets now define another division inside level0:

<style tyle="text/css">
<!--
#level1 {
    margin-left:143px;
    padding-left:9px;
    background:#FFF;
}
-->
</style>


Now we will nest one more division inside level1 and we will change just background color:

<style tyle="text/css">
<!--
#level2 {
    background:#FFF3AC;
}
-->
</style>


Finally we use the same technique, nest a level3 division inside level2 to get the visual layout for the right column:

<style tyle="text/css">
<!--
#level3 {
    margin-right:143px;
    padding-right:9px;
    background:#FFF;
}
#main {
    background:#CCC;
}
-->
</style>


์œ„ ์†Œ์Šค๋“ค์„ ๋ชจ๋‘ ํ•ฉ์ณ์„œ ํ•˜๋‚˜๋กœ ๋งŒ๋“ค์–ด๋ณด์ฃ 

<style tyle="text/css">
<!--
body {
    margin:9px 9px 0 9px;
    padding:0;
    background:#FFF;}
  #level0 {
    background:#FC0;}
  #level1 {
    margin-left:143px;
    padding-left:9px;
    background:#FFF;}
  #level2 {
    background:#FFF3AC;}
  #level3 {
    margin-right:143px;
    padding-right:9px;
    background:#FFF;}
  #main {
    background:#CCC;}
-->
</style>
<body>
  <div id="level0">
    <div id="level1">
      <div id="level2">
        <div id="level3">
          <div id="main">
            Final Content goes here...
          </div>
        </div>
      </div>
    </div>
  </div>
</body>


์ž, ์ด์ œ ์ด๊ฑธ ํ…Œ์ŠคํŠธ ํ•ด๋ณด์„ธ์š”. ^____^








Reference : http://www.tutorialspoint.com/css/css_layouts.htm





์ž~ ์˜ค๋Š˜์€ CSS ํ•„ํ„ฐ์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณผ ํ…๋ฐ์š”~ ์ˆœ์ˆ˜ํ•œ CSS๋ฅผ ์ด์šฉํ•ด์„œ ํ…์ŠคํŠธ๋‚˜ ์ด๋ฏธ์ง€ ๋“ฑ๋“ฑ์— ํšจ๊ณผ๋ฅผ ์ฃผ๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ์•„๋ณผ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์ด ํ•„ํ„ฐ๋Š” IE 4.0 ์ด์ƒ์—์„œ๋งŒ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค. 

( ํ…Œ์ŠคํŠธ๋ฅผ ํ•ด๋ดค๋Š”๋ฐ ์ด CSS ํ•„ํ„ฐ๋Š” ์ตœ๊ทผ ๋ธŒ๋ผ์šฐ์ €( Chrome, IE, FireFox )์—์„œ๋Š” ์ง€์›์„ ์•ˆํ•˜๋Š” ๊ฒƒ ๊ฐ™๋„ค์š”..^^;; ๊ทธ๋ƒฅ ์ด๋Ÿฐ ๊ฒƒ๋„ ์žˆ๊ตฌ๋‚˜ ํ•˜์‹œ๋ฉด ๋ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.)


์ž, ๊ทธ๋Ÿผ CSS ํ•„ํ„ฐ์— ๋Œ€ํ•ด์„œ ํ•˜๋‚˜ํ•˜๋‚˜ ์•Œ์•„๋ณด๋„๋ก ํ• ๊นŒ์š”?


๋ชจ๋“  ์˜ˆ์ œ๋Š” ๋ธŒ๋ผ์šฐ์ € ๋ณ„๋กœ ๊ฒฐ๊ณผ๊ฐ€ ๋‹ค๋ฅด๊ฒŒ ๋ณด์ผ ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ๋ช…์‹ฌํ•˜์„ธ์š”. ์ ์šฉ์ด ์•ˆ๋˜๋Š” ๋ธŒ๋ผ์šฐ์ €๋„ ์žˆ์Šต๋‹ˆ๋‹ค.


Alpha Channel

์ด๊ฑด ๋ญ ์ด๋ฏธ ๋‹ค ์•„์‹œ๋ฆฌ๋ผ ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ์•ŒํŒŒ ๊ฐ’์ด์ฃ . ๊ฐ์ฒด์˜ ํˆฌ๋ช…๋„๋ฅผ ์„ค์ •ํ•˜๋Š” ํ•„ํ„ฐ์ž…๋‹ˆ๋‹ค.

๋‹ค์Œ์€ ์ด ํ•„ํ„ฐ์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ํŒŒ๋ผ๋ฏธํ„ฐ์™€ ๊ทธ์—๋Œ€ํ•œ ์„ค๋ช…์ž…๋‹ˆ๋‹ค.

ParameterDescription
opacityLevel of the opacity. 0 is fully transparent, 100 is fully opaque.
finishopacityLevel of the opacity at the other end of the object.
styleThe shape of the opacity gradient.

0 = uniform
1 = linear
2 = radial
3 = rectangular
startXX coordinate for opacity gradient to begin.
startYY coordinate for opacity gradient to begin.
finishXX coordinate for opacity gradient to end.
finishYY coordinate for opacity gradient to end.

์˜ˆ์ œ:

<p>Image Example:</p>
<img src="/images/css.gif" alt="CSS Logo" style="Filter: Alpha(Opacity=100, FinishOpacity=0, Style=2, StartX=20, StartY=40, FinishX=0, FinishY=0)">

<p>Text Example:</p>
<div style="width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: blue; Filter: Alpha(Opacity=100, FinishOpacity=0, Style=1, StartX=0, StartY=0, FinishX=580, FinishY=0)">CSS Tutorials</div>




Motion Blur

This will be used to create blurred pictures or text with the direction and strength. Following are the parameters which can be used in this filter:

ParameterDescription
addTrue or false. If true the image is added to the blurred image and if false the image is not added to the blurred image.
directionThe direction of the blur, going clockwise, rounded to 45-degree increments. The default value is 270 (left).

0 = Top
45 = Top right
90 = Right
135 = Bottom right
180 = Bottom
225 = Bottom left
270 = Left
315 = Top left
strengthThe number of pixels the blur will extend. The default is 5 pixels.

์˜ˆ์ œ:

<p>Image Example:</p>
<img src="/images/css.gif" alt="CSS Logo" style="Filter: Blur(Add = 0, Direction = 225, Strength = 10)">

<p>Text Example:</p>
<div style="width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: blue; Filter: Blur(Add = 1, Direction = 225, Strength = 10)">CSS Tutorials</div>


Chroma Filter

This will be used to make any particular color transparent and usually it is used with images. You can use it with scrollbars also.Following are the parameters which can be used in this filter:

ParameterDescription
color The color that you'd like to be transparent.

์˜ˆ์ œ:

<p>Image Example:</p>
<img src="/images/css.gif" alt="CSS Logo" style="Filter: Chroma(Color = #FFFFFF)">

<p>Text Example:</p>
<div style="width: 580; height: 50; font-size: 30pt; font-family: Arial Black; color: #3300FF; Filter: Chroma(Color = #3300FF)">CSS Tutorials</div>




Drop Shadow Effect

This will be used to create a shadow of your object at the specified X (horizontal) and Y (vertical) offset and color. . Following are the parameters which can be used in this filter:

ParameterDescription
color The color, in #RRGGBB format, of the dropshadow.
offX Number of pixels the drop shadow is offset from the visual object, along the x-axis. Positive integers move the drop shadow to the right, negative integers move the drop shadow to the left.
offY Number of pixels the drop shadow is offset from the visual object, along the y-axis. Positive integers move the drop shadow down, negative integers move the drop shadow up.
positiveIf true, all opaque pixels of the object have a dropshadow. If false, all transparent pixels have a dropshadow. The default is true.

์˜ˆ์ œ:

<p>Image Example:</p>
<img src="/images/css.gif" alt="CSS Logo" style="Filter: Chroma(Color = #000000) DropShadow(Color=#FF0000, OffX=2, OffY=2, Positive=1)">

<p>Text Example:</p>
<div style="width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; Filter: DropShadow(Color=#000000, OffX=2, OffY=2, Positive=1)">CSS Tutorials</div>




Flip Effect

This will be used to create a mirror image of the object. Following are the parameters which can be used in this filter:

ParameterDescription
FlipH Creates a horizontal mirror image
FlipV Creates a vertical mirror image

์˜ˆ์ œ:

<p>Image Example:</p>
<img src="/images/css.gif" alt="CSS Logo" style="Filter: FlipH">

<img src="/images/css.gif" alt="CSS Logo" style="Filter: FlipV">

<p>Text Example:</p>
<div style="width: 300; height: 50; font-size: 30pt; font-family: Arial Black; color: red; Filter: FlipV">CSS Tutorials</div>




Glow Effect

This will be used to create a glow around the object. If it is a transparent image then glow is created around the opaque pixels of it. Following are the parameters which can be used in this filter:

ParameterDescription
color The color you want the glow to be.
strengthThe intensity of the glow (from 1 to 255).

์˜ˆ์ œ:

<p>Image Example:</p>
<img src="/images/css.gif" alt="CSS Logo" style="Filter: Chroma(Color = #000000) Glow(Color=#00FF00, Strength=20)">

<p>Text Example:</p>
<div style="width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; Filter: Glow(Color=#00FF00, Strength=20)">CSS Tutorials</div>




Grayscale Effect

This will be used to convert the colors of the object to 256 shades of gray. Following are the parameters which can be used in this filter:

ParameterDescription
gray Converts the colors of the object to 256 shades of gray.

์˜ˆ์ œ:

<p>Image Example:</p>
<img src="/images/css.gif" alt="CSS Logo" style="Filter: Gray">

<p>Text Example:</p>
<div style="width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; Filter: Gray">CSS Tutorials</div>




Invert Effect

This will be used to map the colors of the object to their opposite value in the color spectrum ie. to create a negative image. Following are the parameters which can be used in this filter:

ParameterDescription
InvertMaps the colors of the object to their opposite value in the color spectrum.

์˜ˆ์ œ:

<p>Image Example:</p>
<img src="/images/css.gif" alt="CSS Logo" style="Filter: invert">

<p>Text Example:</p>
<div style="width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; Filter: invert">CSS Tutorials</div>


Mask Effect

This will be used to turn transparent pixels to a specified color and makes opaque pixels transparent. Following are the parameters which can be used in this filter:

ParameterDescription
color The color that the transparent areas will become.

์˜ˆ์ œ:

<p>Image Example:</p>
<img src="/images/css.gif" alt="CSS Logo" style="FILTER: Chroma(Color = #000000) Mask(Color=#00FF00)">

<p>Text Example:</p>
<div style="width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; Filter: Mask(Color=#00FF00)">CSS Tutorials</div>




Shadow Filter

This will be used to create an attenuated shadow in the direction and color specified. This is a filter lies in between Dropshadow and a Glow. Following are the parameters which can be used in this filter:

ParameterDescription
color The color that you want the shadow to be.
directionThe direction of the blur, going clockwise, rounded to 45-degree increments. The default value is 270 (left).

0 = Top
45 = Top right
90 = Right
135 = Bottom right
180 = Bottom
225 = Bottom left
270 = Left
315 = Top left

์˜ˆ์ œ:

<p>Image Example:</p>
<img src="/images/css.gif" alt="CSS Logo" style="FILTER: Chroma(Color = #000000) Shadow(Color=#00FF00, Direction=225)">

<p>Text Example:</p>
<div style="width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; Filter: Shadow(Color=#0000FF, Direction=225)">CSS Tutorials</div>




Wave Effect

This will be used to gives the object a sine wave distortion to make it look wavey. Following are the parameters which can be used in this filter:

ParameterDescription
addA value of 1 adds the original image to the waved image, 0 does not.
freq The number of waves.
lightThe strength of the light on the wave (from 0 to 100).
phase At what degree the sine wave should start (from 0 to 100).
strength The intensity of the wave effect.

์˜ˆ์ œ:

<p>Image Example:</p>
<img src="/images/css.gif" alt="CSS Logo" style="FILTER: Chroma(Color = #000000) Wave(Add=0, Freq=1, LightStrength=10, Phase=220, Strength=10)">

<p>Text Example:</p>
<div style="width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; Filter: Wave(Add=0, Freq=1, LightStrength=10, Phase=20, Strength=20)">CSS Tutorials</div>




X-Ray Effect

This will be used to grayscales and flattens the color depth. Following are the parameters which can be used in this filter:

ParameterDescription
xrayGrayscales and flattens the color depth.

์˜ˆ์ œ:

<p>Image Example:</p>
<img src="/images/css.gif" alt="CSS Logo" style="Filter: Xray"">

<p>Text Example:</p>
<div style="width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; style="Filter: Xray">CSS Tutorials</div>






Reference : http://www.tutorialspoint.com/css/css_text_effects.htm 





๐Ÿ’ป Programming/CSS

[CSS] 25. @ Rules ( @ ๊ทœ์น™๋“ค )

์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” @ ๊ทœ์น™์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

๋ฌธ์„œ์— ๋‹ค๋ฅธ CSSํŒŒ์ผ์„ importํ•  ๋•Œ @import๋ฅผ ์“ฐ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.  

์ด๋Ÿฐ ๊ทœ์น™๋“ค์ด ๋ช‡๊ฐ€์ง€ ์žˆ๋Š”๋ฐ ์ด๋ฒˆ์—๋Š” ๋‹ค์Œ ๋„ค๊ฐ€์ง€์— ๋Œ€ํ•ด์„œ๋งŒ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. 

 

  • @import ์™ธ๋ถ€ CSSํŒŒ์ผ์„ ํ˜„์žฌ CSSํŒŒ์ผ์— importํ•ฉ๋‹ˆ๋‹ค.

  • @charset CSSํŒŒ์ผ์˜ ์บ๋ฆญํ„ฐ์…‹์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

  • @font-face ๋ฌธ์„œ์—์„œ์˜ ๋ฌธ์„œ์ฒด๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

  • !important ๋‹ค๋ฅธ ์Šคํƒ€์ผ์„ ์˜ค๋ฒ„๋ผ์ด๋“œ ํ•ฉ๋‹ˆ๋‹ค.

NOTE: ์œ„ ๋„ค๊ฐ€์ง€ ์ด์™ธ์—๋„ ๋‹ค๋ฅธ ๊ทœ์น™๋“ค๋„ ์žˆ์ง€๋งŒ ์—ฌ๊ธฐ์„œ๋Š” ๋‹ค๋ฃจ์ง€ ์•Š์Šต๋‹ˆ๋‹ค. 


The @import rule

์ด ๊ทœ์น™์€ ์•„๋ž˜ ๋‘๊ฐ€์ง€ ๋ฐฉ๋ฒ•์ค‘ ํ•œ๊ฐ€์ง€ ๋ฐฉ๋ฒ•์œผ๋กœ ์‚ฌ์šฉํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

๋กœ์ปฌํŒŒ์ผ์„ importํ•˜๋Š” ๋ฐฉ๋ฒ•๊ณผ url์„ ์ด์šฉํ•˜์—ฌ ์›๊ฒฉํŒŒ์ผ์„ importํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ์Šต๋‹ˆ๋‹ค. 

<style tyle="text/css">
<!--
@import "mystyle.css";
or
@import url("mystyle.css");
.......other CSS rules .....
-->
</style>

CSS๋ฅผ ๋ชจ๋“ˆํ™” ํ•  ์ˆ˜ ์žˆ๊ฒŒ๋” ํ•ด์ฃผ๋Š” ๊ทœ์น™์ด๋ฏ€๋กœ ์ค‘์š”ํ•œ ๊ทœ์น™์ด๊ณ  ์ž์ฃผ ์‚ฌ์šฉํ•˜์‹œ๊ฒŒ ๋ ๊ฒ๋‹ˆ๋‹ค. 


The @charset Rule

์บ๋ฆญํ„ฐ์…‹์„ ์ •์˜ํ•˜๋Š” ๊ทœ์น™์ด์ฃ . ๋ณ„๊ฑฐ ์—†์Šต๋‹ˆ๋‹ค.

<style tyle="text/css">
<!--
@charset "iso-8859-1"
.......other CSS rules .....
-->
</style>


The @font-face Rule

๋ฌธ์„œ๋‚ด์—์„œ ์‚ฌ์šฉ๋  ๋ฌธ์„œ์ฒด๋ฅผ ์ •์˜ํ•˜๋Š” ๊ทœ์น™์ž…๋‹ˆ๋‹ค. ๋˜ํ•œ ๋‹ค์šด๋กœ๋“œํ•  ํฐํŠธ์˜ ์œ„์น˜๋ฅผ ์ง€์ •ํ•ด์ฃผ๊ธฐ ์œ„ํ•œ ๊ทœ์น™์ด๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค.

์ผ๋ฐ˜์ ์œผ๋กœ @font-face ๊ทœ์น™์€ ๋งค์šฐ ๋ณต์žกํ•˜๊ณ  ํฐํŠธ ์ „๋ฌธ๊ฐ€๊ฐ€ ์•„๋‹Œ ์ด์ƒ ์‚ฌ์šฉ์„ ๊ถŒ์žฅํ•˜์ง€๋„ ์•Š์Šต๋‹ˆ๋‹ค.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ๋ณด์‹œ์ฃ . 

<style tyle="text/css">
<!--
@font-face {
  font-family: "Scarborough Light";
 src: url("http://www.font.site/s/scarbo-lt");
}
@font-face {
 font-family: Santiago;
 src: local ("Santiago"),
 url("http://www.font.site/s/santiago.tt")
 format("truetype");
 unicode-range: U+??,U+100-220;
 font-size: all;
 font-family: sans-serif;
}
-->
</style>


The !important Rule

CSS๊ฐ€ ๋ธŒ๋ผ์šฐ์ €์— ์ ์šฉ๋  ๋•Œ ์ˆœ์„œ๋Œ€๋กœ ์ ์šฉ์ด ๋˜๋„๋ก ๋˜์–ด์žˆ์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์•ž์—์„œ ์ •์˜ํ–ˆ๋˜ ๊ฒƒ์ด ์ ์šฉ์ด ๋œ ๋’ค์— ๋งˆ์ง€๋ง‰์— ์ •์˜ํ•œ ๊ฒƒ์ด ์ ์šฉ์ด ๋˜๋Š”๋ฐ ์ด๋•Œ ๋™์ผํ•œ ์š”์†Œ์— ๋Œ€ํ•ด์„œ ๋‹ค๋ฅธ ๊ฐ’์„ ์ •์˜ํ•ด๋ฒ„๋ฆฌ๋ฉด ๋งˆ์ง€๋ง‰์— ์ •์˜ํ•œ ๊ฐ’์ด ์ ์šฉ๋˜๊ณ  ์•ž์—์„œ ์ •์˜ํ•œ ๊ฐ’์€ ์ ์šฉ์ด ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. 

๋งŒ์•ฝ ์–ด๋–ค ์†์„ฑ์ด ์ •๋ง ์ค‘์š”ํ•ด์„œ ์ด๊ฑด ์‹ค์ˆ˜๋กœ ์˜ค๋ฒ„๋ผ์ด๋“œ ๋˜๋ฉด ์•ˆ๋œ๋‹ค ์‹ถ์„๋•Œ ์‚ฌ์šฉํ•˜๋Š”๊ฒƒ์ด ๋ฐ”๋กœ ์ด !important ๊ทœ์น™์ž…๋‹ˆ๋‹ค.  

์ด ๊ทœ์น™์„ ์ ์šฉํ•œ ์Šคํƒ€์ผ์€ ๋ฌธ์„œ์˜ ์–ด๋Š๊ณณ์—๋‚˜ ์žˆ์–ด๋„ ์ ์šฉ์ด ๋ฉ๋‹ˆ๋‹ค. 

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณด์‹œ์ฃ .

<style tyle="text/css">
<!--
p { color: #ff0000; }
p { color: #000000; }
-->
</style>

๋™์ผํ•œ ์š”์†Œ์— ์„œ๋กœ๋‹ค๋ฅธ ์ƒ‰์ƒ์„ ์ ์šฉ์‹œํ‚ค๋Š” ์Šคํƒ€์ผ์ด ์„ ์–ธ๋˜์–ด์žˆ์Šต๋‹ˆ๋‹ค. ์•ž์—๊บผ๋Š” ๋นจ๊ฐ„์ƒ‰, ๋’ค์—๊บผ๋Š” ๊ฒ€์€์ƒ‰์ด์ฃ . ๊ทธ๋Ÿฌ๋ฉด ํ›„์ž์ธ ๊ฒ€์ •์ƒ‰๋งŒ ์ ์šฉ์ด ๋ฉ๋‹ˆ๋‹ค. ์ด๋•Œ ๋นจ๊ฐ„์ƒ‰ ์†์„ฑ์ด ์ค‘์š”ํ•œ ์†์„ฑ์ด๋‹ค๋ผ๊ณ  ์•„๋ž˜์ฒ˜๋Ÿผ ์„ ์–ธ์„ ํ•ด์ฃผ์‹œ๋ฉด....

<style tyle="text/css">
<!--
p { color: #ff0000 !important; }
p { color: #000000; }
-->
</style>

๋’ค์— ๊ฒ€์€์ƒ‰ ์†์„ฑ์„ ์ •์˜ํ–ˆ๋‹ค๊ณ  ํ•˜๋”๋ผ๋„ ๋นจ๊ฐ„์ƒ‰์ด ์ ์šฉ๋˜์–ด์ง€๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

 

 

 

 

 

 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_at_rules.htm 

 

 

 

 

 

์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” ์Šˆ๋„ ์—˜๋ฆฌ๋จผํŠธ๋“ค์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

์ด๋…€์„๋“ค์€ ์Šˆ๋„ ํด๋ž˜์Šค์™€ ๋น„์Šทํ•œ ๋…€์„๋“ค์ž…๋‹ˆ๋‹ค.  

 

์ด๋ฆ„ ๋ง๊ณ ๋Š” ๋‹ค๋ฅธ๊ฒŒ ์—†์–ด๋ณด์ด๋„ค์š”. ( ์‚ฌ์‹ค ์ €๋„ ์ž˜ ๋ชฐ๋ผ์„œ ...ใ…‹ใ…‹ใ…‹ )

 

๋ฌธ๋ฒ•๋„ ์Šˆ๋„ ํด๋ž˜์Šค์™€ ๋™์ผํ•ด๋ณด์ž…๋‹ˆ๋‹ค.

selector:pseudo-element {property: value}

 

CSS ํด๋ž˜์Šค์™€ ํ•จ๊ป˜ ์“ฐ์ด๊ธฐ๋„ ํ•˜์ฃ .

selector.class:pseudo-element {property: value}

 

๊ฐ€์žฅ ๋งŽ์ด ์‚ฌ์šฉ๋˜๋Š” pseudo-elements์—๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฒƒ๋“ค์ด ์žˆ์Šต๋‹ˆ๋‹ค. 

ValueDescription
:first-lineUse this element to add special styles to the first line of the text in a selector.
:first-letterUse this element to add special style to the first letter of the text in a selector.
:beforeUse this element to insert some content before an element.
:after Use this element to insert some content after an element.


The :first-line pseudo-element

Following is the example which demonstrates how to use :first-line element to add special effect to the first line of elements in the document .

<style type="text/css">
p:first-line { text-decoration: underline; }
p.noline:first-line { text-decoration: none; }
</style>
<p class="noline"> This line would not have any underline
because this belongs to nline class.</p>

<p>The first line of this paragraph will be underlined
as defined in the CSS rule above. Rest of the lines in this
paragraph will remain normal. This example shows how to use
:first-line pseduo element to give effect to the first line
of any HTML element.</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.



The :first-letter pseudo-element

Following is the example which demonstrates how to use :first-letter element to add special effect to the first letter of elements in the document .

<style type="text/css">
p:first-letter { font-size: 3em; text-color:red; }
p.normal:first-letter { font-size: 10px; }
</style>
<p class="normal"> First character of this paragraph will 
be normal and will have font size 10 px;</p>

<p>The first character of this paragraph will be 3em big
and in red color as defined in the CSS rule above. Rest of the
characters in this paragraph will remain normal. This example 
shows how to use :first-letter pseduo element to give effect to
the first characters  of any HTML element.</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.




The :before pseudo-element

Following is the example which demonstrates how to use :before element to add some content before any element .

<style type="text/css">
p:before
{
content: url(/images/bullet.gif)
}
</style>
<p> This line will be preceded by a bullet.</p>
<p> This line will be preceded by a bullet.</p>
<p> This line will be preceded by a bullet.</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

 


The :after pseudo-element

Following is the example which demonstrates how to use :after element to add some content after any element .

<style type="text/css">
p:after
{
content: url(/images/bullet.gif)
}
</style>
<p> This line will be succeeded by a bullet.</p>
<p> This line will be succeeded by a bullet.</p>
<p> This line will be succeeded by a bullet.</p>

 

 

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

 

 

 

 

 

์†์ˆ˜ ํŽ˜์ด์ง€ ๋งŒ๋“ค์–ด์„œ ์ง์ ‘ ํ…Œ์ŠคํŠธ ํ•ด๋ณด๋Š” ๊ฒƒ ์žŠ์ง€ ๋งˆ์„ธ์š”.!!!! ^-^ 

 

 

 

 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_pseudo_elements.htm

 

 

 

 

 

 

 

<<" ">>" "<" ">"; } </style>

์ด๋ฒˆ์—๋Š” CSS์˜ ์Šˆ๋„ํด๋ž˜์Šค์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.  

์Šˆ๋„ํด๋ž˜์Šค๋Š” ํŠน์ • ์…€๋ ‰ํ„ฐ์— ํŠน๋ณ„ํ•œ ํšจ๊ณผ๋ฅผ ๋ถ€์—ฌํ•˜๊ธฐ ์œ„ํ•ด์„œ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. Javascript ๋‚˜ ์–ด๋– ํ•œ ๋‹ค๋ฅธ script ๋ฅผ ์‚ฌ์šฉํ•  ํ•„์š”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.

 

์Šˆ๋„ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ธฐ๋ณธ์ ์ธ ๋ฌธ๋ฒ•์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. 

selector:pseudo-class {property: value}

 

CSS ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. 

selector.class:pseudo-class {property: value}

 

๋‹ค์Œ์€ ๊ฐ€์žฅ ๋งŽ์ด ์‚ฌ์šฉ๋˜๋Š” ์Šˆ๋„ ํด๋ž˜์Šค๋“ค ๋ชฉ๋ก ๋ฐ ์„ค๋ช…์ž…๋‹ˆ๋‹ค.

ValueDescription
:linkUse this class to add special style to an unvisited link.
:visitedUse this class to add special style to a visited link.
:hoverUse this class to add special style to an element when you mouse over it.
:active Use this class to add special style to an active element.
:focusUse this class to add special style to an element while the element has focus.
:first-childUse this class to add special style to an element that is the first child of some other element.
:langUse this class to specify a language to use in a specified element.

<style>...</style> ๋ธ”๋ฝ ๋‚ด์— ์Šˆ๋„ ํด๋ž˜์Šค๋ฅผ ์ด์šฉํ•˜๊ฒŒ ๋  ๋•Œ์—๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์‚ฌํ•ญ์„ ์ฃผ์˜ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. 

  • a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective.

  • a:active MUST come after a:hover in the CSS definition in order to be effective.

  • Pseudo-class names are not case-sensitive.

  • Pseudo-class are different from CSS classes but they can be combined.


The :link pseudo-class

๋‹ค์Œ์€ ๋‹จ์ˆœํžˆ ๋งํฌ์˜ ์ƒ‰์ƒ์„ ๋ณ€๊ฒฝํ•˜๋Š” ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค. 

<style type="text/css">
a:link {color:#000000}
</style>
<a href="/html/index.htm">Black Link</a>


The :visited pseudo-class

๋‹ค์Œ์€ ํ•œ๋ฒˆ ์ด์ƒ ๋ฐฉ๋ฌธํ•œ ๋งํฌ์˜ ์ƒ‰์ƒ์„ ๋ณ€๊ฒฝํ•˜๋Š” ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค. 

<style type="text/css">
a:visited {color: #006600}
</style>
<a href="/html/index.htm">Click this link</a>

 

 

 

 

 

The :hover pseudo-class

๋‹ค์Œ์€ ๋งˆ์šฐ์Šค ์ปค์„œ๊ฐ€ ๋งํฌ ์œ„์— ์˜ฌ๋ผ๊ฐ”์„ ๋•Œ ์ƒ‰๊น”์„ ๋ณ€๊ฒฝํ•˜๋„๋ก ํ•˜๋Š” ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค.

<style type="text/css">
a:hover {color: #FFCC00}
</style>
<a href="/html/index.htm">Bring Mouse Here</a>



The :active pseudo-class

 :active ์Šˆ๋„ ํด๋ž˜์Šค๋Š” ํ™œ์„ฑํ™”๋œ ์š”์†Œ์— ๋Œ€ํ•œ ์†์„ฑ์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.  

๋‹ค์Œ์€ ํ™œ์„ฑํ™”๋œ ๋งํฌ์˜ ์ƒ‰์ƒ์„ ๋ณ€๊ฒฝํ•˜๋Š” ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค. 

<style type="text/css">
a:active {color: #FF00CC}
</style>
<a href="/html/index.htm">Click This Link</a>



The :focus pseudo-class

์ด ํด๋ž˜์Šค๋Š” ํฌ์ปค์Šค๋ฅผ ๋ฐ›์€ ์š”์†Œ์— ๋Œ€ํ•œ ์†์„ฑ์˜ ์†์„ฑ๊ฐ’์„ ์ง€์ •ํ•  ๋•Œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. 

๋‹ค์Œ์€ ํฌ์ปค์Šค๋œ ๋งํฌ์˜ ์ƒ‰์ƒ์„ ๋ณ€๊ฒฝํ•˜๋Š” ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค. 

<style type="text/css">
a:focus {color: #0000FF}
</style>
<a href="/html/index.htm">Click this Link</a>

 

 

 


The :first-child pseudo-class

 :first-child ์Šˆ๋„ ํด๋ž˜์Šค๋Š” ์ด๋ฆ„๋งŒ ๋ด๋„ ์ฒซ๋ฒˆ์งธ ์ž์‹์— ๋Œ€ํ•œ ์†์„ฑ์„ ์„ค์ •ํ•˜๋Š”๊ฑฐ๋ผ๊ณ  ๋ณด์ด๋„ค์š”.

์ด ์Šˆ๋„ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉํ•˜์‹œ๋ ค๋ฉด IE ์—์„œ๋Š” ๋ฌธ์„œ ๊ฐ€์žฅ ์œ—๋ถ€๋ถ„์— <!DOCTYPE> ๋ฅผ ๋„ฃ์–ด์ฃผ์…”์•ผ ํ•ฉ๋‹ˆ๋‹ค.

 

๊ทธ๋Ÿผ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณด์‹œ์ฃ . ๋ชจ๋“  divํƒœ๊ทธ์˜ ์ฒซ๋ฒˆ์งธ ๋ฌธ๋‹จ์„ ์ธ๋ดํŠธํ•˜์—ฌ ํ™”๋ฉด์— ๋ฟŒ๋ ค์ฃผ๋Š” ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค. 

<style type="text/css">
div > p:first-child
{
text-indent: 25px;
}
</style>
<div>
<p>
First paragraph in div. This paragraph will be indented
</p>
<p>
Second paragraph in div. This paragraph will not be  indented
</p>
</div>

But it will not match the paragraph in this HTML:

<div>
<h3>Heading</h3>
<p>
The first paragraph inside the div.
This paragraph will not be effected.
</p>
</div>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. 

       First paragraph in div. This paragraph will be indented

Second paragraph in div. This paragraph will not be indented

But it will not match the paragraph in this HTML:

Heading

The first paragraph inside the div.
This paragraph will not be effected.

 


The :lang pseudo-class

 :lang ์Šˆ๋„ ํด๋ž˜์Šค๋Š” ํŠน์ • ์š”์†Œ์˜ lang์†์„ฑ์— ๋”ฐ๋ผ์„œ ๋‹ค๋ฅธ ๊ฐ’์„ ์ค„ ๋•Œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

๋‹ค๊ตญ์–ด ์ฒ˜๋ฆฌ๋ฅผ ํ•„์š”๋กœํ•˜๋Š” ์›นํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“ค๋•Œ ์œ ์šฉํ•˜๊ฒŒ ์‚ฌ์šฉํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด ์ธ์šฉ๋ฌธ๊ตฌ ๊ฐ™์€ ๊ฒฝ์šฐ์— ๋ถˆ์–ด์—์„œ๋Š” ๊บฝ์‡  ๋‘๊ฐœ๋กœ ์ธ์šฉ๋ฌธ๊ตฌ๋ฅผ ํ‘œํ˜„ํ•˜์ง€๋งŒ ์˜์–ด์—์„œ๋Š” ๊ทธ๋ƒฅ ํ™‘๋”ฐ์˜ดํ‘œ๋‚˜ ์Œ๋”ฐ์˜ดํ‘œ๋ฅผ ์ด์šฉํ•ฉ๋‹ˆ๋‹ค. ์ด๋Ÿด๋•Œ ์ด :lang ์Šˆ๋„ ํด๋ž˜์Šค๋ฅผ ์ด์šฉํ•˜์‹œ๋ฉด ์ข‹์Šต๋‹ˆ๋‹ค.

๊ทธ๋Ÿผ ์˜ˆ์ œ๋ฅผ ํ†ตํ•ด์„œ ์ข€๋” ์•Œ์•„๋ณด๋„๋ก ํ•˜์ฃ .  

 

๋‹ค์Œ ์˜ˆ์ œ๋Š” <blockquote> ํƒœ๊ทธ๋ฅผ ํ˜„์žฌ ์‚ฌ์šฉ์ค‘์ธ ์–ธ์–ด์— ๋งž๊ฒŒ ๋ณ€๊ฒฝํ•ด์ค๋‹ˆ๋‹ค.

<style type="text/css">
/* Two levels of quotes for two languages*/
:lang(en) { quotes: '"' '"'  "'"  "'"; }
:lang(fr) { quotes: "<<" ">>" "<" ">"; }
</style>
<p>...<q lang="fr">A quote in a paragraph</q>...</p>

์œ„ ์˜ˆ์ œ์—์„œ :lang ์…€๋ ‰ํ„ฐ๋Š” ๋ฌธ์„œ ์ „์ฒด ์š”์†Œ์— ์ ์šฉ๋ฉ๋‹ˆ๋‹ค.   

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. 

 

...<<A quote in a paragraph>>...

 

 

 

 

 


 

 

Reference : http://www.tutorialspoint.com/css/css_pseudo_classes.htm

 

 

 

 

 


๐Ÿ’ป Programming/CSS

[CSS] 22. Layers ( ๋ ˆ์ด์–ด )

์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” ๋ ˆ์ด์–ด ๊ด€๋ จ CSS์†์„ฑ์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

์ค‘ํ•™๊ต ๋•Œ ์ง‘ํ•ฉ์„ ๋ฐฐ์šฐ๊ฒŒ ๋˜๋ฉด ๋™๊ทธ๋ผ๋ฏธ ๋‘๊ฐœ๋ฅผ ๊ฒน์ณ์„œ ๊ทธ๋ฆฌ๋Š” ๊ฒƒ ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜์ฃ ?

๊ทธ๋Ÿฐ๊ฒƒ์ด ๋ฐ”๋กœ ๋ ˆ์ด์–ด๋ง ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

 

๋ ˆ์ด์–ด๋ง์„ ์œ„ํ•œ ์†์„ฑ์—๋Š” z-index๋ผ๋Š” ๊ฒƒ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณผ๊นŒ์š”??

 

<div style="background-color:red;
 width:300px;
 height:100px;
 position:relative;
 top:10px;
 left:80px;
 z-index:2">
</div>
<div style="background-color:yellow;
 width:300px;
 height:100px;
 position:relative;
 top:-60px;
 left:35px;
 z-index:1;">
</div>
<div style="background-color:green;
width:300px;
 height:100px;
 position:relative;
 top:-220px;
 left:120px;
 z-index:3;">
</div>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์ฒ˜๋Ÿผ ๋‚˜์˜ฌ ๊ฒƒ์ž…๋‹ˆ๋‹ค. 




์–ด๋–ค๊ฐ€์š”??? ๊ฐ„๋‹จํ•˜์ฃ ???


 

 

 

 

 

 

Reference :  http://www.tutorialspoint.com/css/css_layers.htm

 

 

 

 

 

์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” CSS๋ฅผ ์ด์šฉํ•œ ์œ„์น˜ ์„ค์ •์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

์šฐ์„  CSS์—์„œ ์ œ๊ณตํ•˜๋Š” ์œ„์น˜ ๊ด€๋ จ ์†์„ฑ์€ position์ด ์žˆ์Šต๋‹ˆ๋‹ค.

 

๊ทธ๋ฆฌ๊ณ  ์œ„์น˜๋Š” ํฌ๊ฒŒ ์ ˆ๋Œ€์œ„์น˜์™€ ์ƒ๋Œ€์œ„์น˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

 

๊ทธ๋Ÿผ ํ•˜๋‚˜์”ฉ ์•Œ์•„๋ณด๋„๋ก ํ• ๊นŒ์š”? 


Relative Positioning:

์ƒ๋Œ€ ์œ„์น˜ ์„ค์ •์—์„œ ์‚ฌ์šฉ๋˜๋Š” ํ•˜์œ„ ์†์„ฑ์œผ๋กœ๋Š” top, bottom, left์™€ right๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.  

top๊ณผ left์˜ ์†์„ฑ๊ฐ’์ด ๋งˆ์ด๋„ˆ์Šค (- ) ์ˆซ์ž๋ฅผ ์‚ฌ์šฉํ•จ์œผ๋กœ์„œ bottom๊ณผ right๋ฅผ ํ‘œํ˜„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. 

  • Move Left - Use a negative value for left.
  • Move Right - Use a positive value for left.
  • Move Up - Use a negative value for top.
  • Move Down - Use a positive value for top.

NOTE: You can use bottom or right values as well in the same way as top and left.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ๋ณด์‹œ์ฃ .

<div style="position:relative;left:80px;top:2px;
            background-color:yellow;">
This div has relative positioning.
</div>

This will produce following result:

This div has relative positioning.

 


Absolute Positioning:

์ ˆ๋Œ€ ํฌ์ง€์…”๋‹์€ ํŠน์ • ์œ„์น˜์— ํ•ญ์ƒ ์œ„์น˜ํ•  ์ˆ˜ ์žˆ๋„๋ก ๊ณ ์ •์‹œํ‚ค๋Š” ๊ฒƒ์ด์ฃ .

์ƒ๋Œ€ ํฌ์ง€์…”๋‹์ฒ˜๋Ÿผ top, left, bottom, right ๋ชจ๋‘ ์‚ฌ์šฉ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ์‚ฌ์šฉ๋ฐฉ๋ฒ•๋„ ๋™์ผํ•˜์ฃ .

  • Move Left - Use a negative value for left.
  • Move Right - Use a positive value for left.
  • Move Up - Use a negative value for top.
  • Move Down - Use a positive value for top.

NOTE: You can use bottom or right values as well in the same way as top and left.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ๋ณด์‹œ์ฃ .

<div style="position:absolute;left:80px;top:20px;
            background-color:yellow;">
This div has absolute positioning.
</div>

 

๊ฒฐ๊ณผ๋Š” ์ง์ ‘ ํ…Œ์ŠคํŠธํ•ด๋ณด์‹œ๊ณ  ๋ณด๋„๋ก ํ•˜์„ธ์š”. ^_^ 


Fixed Positioning:

๊ณ ์ • ํฌ์ง€์…”๋‹์€ ์ž์นซ ์ž˜๋ชป ์ดํ•ดํ•˜๋ฉด ์ ˆ๋Œ€ ํฌ์ง€์…”๋‹๊ณผ ๋™์ผํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•˜์‹ค ์ˆ˜ ์žˆ๋Š”๋ฐ ์ด ๊ณ ์ • ํฌ์ง€์…”๋‹์€ ์ƒ๋Œ€ + ์ ˆ๋Œ€ ํฌ์ง€์…”๋‹์ด๋ผ๊ณ  ์ƒ๊ฐํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ๊ณ ์ • ํฌ์ง€์…”๋‹์€ ๋ˆˆ์œผ๋กœ ๋ณด์—ฌ์ง€๋Š” ํ™”๋ฉด์˜ ํŠน์ • ์œ„์น˜์— ๊ณ ์ •์‹œํ‚ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์Šคํฌ๋กค๋ง์ด ์žˆ๋”๋ผ๋„ ๋ฌด์กฐ๊ฑด ํ™”๋ฉด์˜ ํŠน์ •์œ„์น˜์— ๋ณด์ด๋„๋ก ํ•˜๋Š” ์†์„ฑ์ด์ฃ .

์—ญ์‹œ ์ƒ๋Œ€, ์ ˆ๋Œ€ ํฌ์ง€์…”๋‹์ฒ˜๋Ÿผ top, left, bottom, right ์†์„ฑ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ ์‚ฌ์šฉ๋ฐฉ๋ฒ•๋„ ๋™์ผํ•ฉ๋‹ˆ๋‹ค. 

  • Move Left - Use a negative value for left.
  • Move Right - Use a positive value for left.
  • Move Up - Use a negative value for top.
  • Move Down - Use a positive value for top.

NOTE: You can use bottom or right values as well in the same way as top and left.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ๋ณด์‹œ์ฃ . 

<div style="position:fixed;left:80px;top:20px;
            background-color:yellow;">
This div has fixed positioning.
</div>

 

๊ฒฐ๊ณผ๋Š” ์ง์ ‘ ํ…Œ์ŠคํŠธํ•ด๋ณด์‹œ๊ณ  ๋ณด๋„๋ก ํ•˜์„ธ์š”. ^_^

 

 

 

 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_positioning.htm 

 

 

 

 

๐Ÿ’ป Programming/CSS

[CSS] 20. Visibility ( ๊ฐ€์‹œ์„ฑ )

์ด๋ฒˆ์—๋Š” CSS๋ฅผ ์ด์šฉํ•ด์„œ ํŠน์ • ์š”์†Œ๋ฅผ ํ™”๋ฉด์—์„œ ์•ˆ๋ณด์ด๋„๋ก ์„ค์ •ํ•˜๋Š” ๊ฒƒ์„ ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.  

ํ™”๋ฉด์„ ๊ตฌ์„ฑํ•˜๋‹ค๋ณด๋ฉด ํ™”๋ฉด์— ๊ทธ๋ฆฌ๊ธฐ๋Š” ๊ทธ๋ ค์•ผ ํ•˜๋Š”๋ฐ ์‚ฌ์šฉ์ž์—๊ฒŒ ๋ณด์—ฌ์ฃผ๋ฉด ์•ˆ๋˜๋Š” ๊ฒƒ๋“ค์ด ์žˆ์„ ์ˆ˜๋„ ์žˆ๊ฒ ์ฃ ?

 

visibility ์†์„ฑ์ด ๋ฐ”๋กœ ๊ทธ๊ฒƒ์„ ์œ„ํ•œ ์†์„ฑ์ž…๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž๊ฐ€ ์›ํ•  ๋•Œ๋งŒ ๋ณด์—ฌ์ฃผ๋ฉด ๋˜๋Š” ๊ทธ๋Ÿฐ ์š”์†Œ๋“ค์„ ์œ„ํ•ด์„œ ์‚ฌ์šฉํ•˜์‹œ๋ฉด ๋˜๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค.


NOTE: ์ค‘์š”ํ•œ ์ •๋ณด๋“ค์„ ๋‹จ์ˆœํžˆ ์•ˆ๋ณด์ด๊ฒŒ๋” ํ•˜๋Š”๋ฐ๋Š” ์‚ฌ์šฉํ•˜์‹œ๋ฉด ์•ˆ๋ฉ๋‹ˆ๋‹ค. ํ™”๋ฉด์— ์ •๋ณด๊ฐ€ ๋ฟŒ๋ ค๋Š” ์ง€์ง€๋งŒ ์‚ฌ๋žŒ ๋ˆˆ์—๋งŒ ์•ˆ๋ณด์ด๋„๋ก ์†์—ฌ๋†“์€ ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— ์–ธ์ œ๋“ ์ง€ ์‚ฌ์šฉ์ž๊ฐ€ ๋ณผ ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ๋ช…์‹ฌํ•˜์„ธ์š”.

 

์ด ์†์„ฑ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์†์„ฑ๊ฐ’๋“ค์„ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ValueDescription
visibleThe box and its contents are shown to the user.
hiddenThe box and its content are made invisible, although they still affect the layout of the page.
collapseThis is for use only with dynamic table columns and row effects.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณด์‹œ์ฃ . 

<p>
This paragraph should be visible in normal way.
</p>
<p style="visibility:hidden;">
This paragraph should not be visible.
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. 

This paragraph should be visible in normal way.

 

 

 

๋‘๊ฐœ์˜ ๋ฌธ๋‹จ์„ ์ถœ๋ ฅํ•˜๋Š”๋ฐ ๋‘๋ฒˆ์งธ ๋ฌธ๋‹จ์€ visibility์†์„ฑ๊ฐ’์ด hidden์ด๋ผ์„œ ๋ˆˆ์— ๋ณด์ด์ง€๋Š” ์•Š๊ฒ ์ง€๋งŒ ์ €๊ธฐ ์œ„์— ๋ถ„๋ช… ์žˆ์Šต๋‹ˆ๋‹ค.

 

 

 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_visibility.htm 

 

 

 

 

์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” CSS๋ฅผ ์ด์šฉํ•ด์„œ ์Šคํฌ๋กค๋ฐ”๋ฅผ ์„ค์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

CSS ์†์„ฑ ์ค‘์— overflow ๋ผ๋Š” ์†์„ฑ์ด ์žˆ๋Š”๋ฐ ์ด๋…€์„์€ ์ปจํ…ํŠธ ๋ฐ•์Šค๋ณด๋‹ค ๋งŽ์€ ์–‘์˜ ์ปจํ…ํŠธ๊ฐ€ ๋“ค์–ด๊ฐˆ ๊ฒฝ์šฐ์— ์ปจํ…ํŠธ๊ฐ€ ์–ด๋–ป๊ฒŒ ๋ณด์—ฌ์ ธ์•ผ ํ•˜๋Š”์ง€์— ๋Œ€ํ•ด์„œ ์„ค์ •ํ•ด์ฃผ๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค.

 

์ด ์†์„ฑ์— ๋Œ€ํ•œ ์†์„ฑ๊ฐ’์€ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฐ’๋“ค์ด ์žˆ์Šต๋‹ˆ๋‹ค. 

ValueDescription
visibleAllows the content to overflow the borders of its containing element.
hiddenThe content of the nested element is simply cut off at the border of the containing element and no scrollbars is visible.
scrollThe size of the containing element does not change, but the scrollbars are added to allow the user to scroll to see the content.
autoThe purpose is the same as scroll, but the scrollbar will be shown only if the content does overflow.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ๋ณด์‹ค๊นŒ์š”. 

<style type="text/css">
.scroll{
 display:block;
 border: 1px solid red;
 padding:5px;
 margin-top:5px;
 width:300px;
 height:50px;
 overflow:scroll;
 }
.auto{
 display:block;
 border: 1px solid red;
 padding:5px;
 margin-top:5px;
 width:300px;
 height:50px;
 overflow:auto;
 }
</style>
<p>Example of scroll value:</p>
<div class="scroll">
I am going to keep lot of content here just to show
you how scrollbars works if there is an overflow in
an element box. This provides your horizontal as well
 as vertical scrollbars.
</div>
<br />
<p>Example of auto value:</p>
<div class="auto">
I am going to keep lot of content here just to show
you how scrollbars works if there is an overflow in
an element box. This provides your horizontal as well
as vertical scrollbars.
</div>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. ( ๊ฒฐ๊ณผ ์ด๋ฏธ์ง€ )

 

 

 ์ง์ ‘ ํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“ค์–ด์„œ ๊ตฌํ˜„ํ•ด๋ณด์„ธ์š”. ^-^ 

 

 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_scrollbars.htm  

 

 

 

 

์ด๋ฒˆ์—๋Š” dimension์— ๋Œ€ํ•ด์„œ ํฌ์ŠคํŒ…์„ ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ ๋งํ•˜๋Š” ๋””๋ฉ˜์…˜์ด๋ž€ 3์ฐจ์› 4์ฐจ์› ์ด๋Ÿฐ ๊ฒƒ์„ ๋งํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๊ณ  ์Œ...๋‹จ์ง€ ๋„ˆ๋น„์™€ ๋†’์ด๋ฅผ ๋‹ค๋ฃจ๋Š” ๊ฒƒ์„ ๋งํ•ฉ๋‹ˆ๋‹ค.  

์ปจํ…ํŠธ๊ฐ€ ๋“ค์–ด๊ฐ€๋Š” ๋ฐ•์Šค์˜ ๋””๋ฉ˜์…˜๊ณผ ๊ด€๋ จ๋œ ์†์„ฑ๋“ค์—๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฒƒ๋“ค์ด ์žˆ์Šต๋‹ˆ๋‹ค.

  •  height ๋ฐ•์Šค์˜ ๋†’์ด๋ฅผ ๊ฒฐ์ •์ง“๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค.

  •  width ๋ฐ•์Šค์˜ ๋„ˆ๋น„๋ฅผ ์ง€์ •ํ•˜๋Š” ์†์„ฑ์ด์ฃ .

  •  line-height ๊ธ€์ž ๋ผ์ธ์˜ ๋†’์ด๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

  •  max-height ๋ฐ•์Šค์˜ ์ตœ๋Œ€ ๋†’์ด๋ฅผ ์ œํ•œํ•ฉ๋‹ˆ๋‹ค.

  •  min-height ๋ฐ•์Šค์˜ ์ตœ์†Œ ๋†’์ด๋ฅผ ์ œํ•œํ•ฉ๋‹ˆ๋‹ค.

  •  max-width ๋ฐ•์Šค์˜ ์ตœ๋Œ€ ๋„ˆ๋น„๋ฅผ ์ œํ•œ.

  •  min-width ๋ฐ•์Šค์˜ ์ตœ์†Œ ๋„ˆ๋น„๋ฅผ ์ œํ•œ.


The height and width Properties:

The height and width properties allow you to set the height and width for boxes. They can take values of a length, a percentage, or the keyword auto.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ๋ณด์‹œ์ฃ . 

<p style="width:400px; height:100px;border:1px solid red;
             padding:5px; margin:10px;">
This paragraph is 400pixels wide and 100 pixels high
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

This paragraph is 400pixels wide and 100 pixels high

 


The line-height Property:

The line-height property allows you to increase the space between lines of text. The value of the line-height property can be a number, a length, or a percentage.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ๋ณด์‹œ์ฃ .

<p style="width:400px; height:100px;border:1px solid red;
             padding:5px; margin:10px;line-height:30px;">
This paragraph is 400pixels wide and 100 pixels high
and here line height is 30pixels.This paragraph is 400 pixels
wide and 100 pixels high and here line height is 30pixels.
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

This paragraph is 400pixels wide and 100 pixels high and here line height is 30pixels.This paragraph is 400 pixels wide and 100 pixels high and here line height is 30pixels.

 


The max-height Property:

The max-height property allows you to specify maximum height of a box. The value of the max-height property can be a number, a length, or a percentage.

NOTE: This property does not work in either Netscape 7 or IE 6.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ๋ณด์‹œ์ฃ .

<p style="width:400px; max-height:10px;border:1px solid red;
             padding:5px; margin:10px;">
This paragraph is 400px wide and max height is 10px
This paragraph is 400px wide and max height is 10px
This paragraph is 400px wide and max height is 10px
This paragraph is 400px wide and max height is 10px
</p>
<img alt="logo" src="/images/css.gif" width="95" height="84" />

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

This paragraph is 400px wide and max height is 10px This paragraph is 400px wide and max height is 10px This paragraph is 400px wide and max height is 10px This paragraph is 400px wide and max height is 10px

logo

 


The min-height Property:

The min-height property allows you to specify minimum height of a box. The value of the min-height property can be a number, a length, or a percentage.

NOTE: This property does not work in either Netscape 7 or IE 6.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ๋ณด์‹œ์ฃ .

<p style="width:400px; min-height:200px;border:1px solid red;
             padding:5px; margin:10px;">
This paragraph is 400px wide and min height is 200px
This paragraph is 400px wide and min height is 200px
This paragraph is 400px wide and min height is 200px
This paragraph is 400px wide and min height is 200px
</p>
<img alt="logo" src="/images/css.gif" width="95" height="84" />

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

This paragraph is 400px wide and min height is 200px This paragraph is 400px wide and min height is 200px This paragraph is 400px wide and min height is 200px This paragraph is 400px wide and min height is 200px

logo

 


The max-width Property:

The max-width property allows you to specify maximum width of a box. The value of the max-width property can be a number, a length, or a percentage.

NOTE: This property does not work in either Netscape 7 or IE 6.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ๋ณด์‹œ์ฃ .

<p style="max-width:100px; height:200px;border:1px solid red;
             padding:5px; margin:10px;">
This paragraph is 200px high and max width is 100px
This paragraph is 200px high and max width is 100px
This paragraph is 200px high and max width is 100px
This paragraph is 200px high and max width is 100px
This paragraph is 200px high and max width is 100px
</p>
<img alt="logo" src="/images/css.gif" width="95" height="84" />

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

This paragraph is 200px high and max width is 100px This paragraph is 200px high and max width is 100px This paragraph is 200px high and max width is 100px This paragraph is 200px high and max width is 100px This paragraph is 200px high and max width is 100px

logo

 


The min-width Property:

The min-width property allows you to specify minimum width of a box. The value of the min-width property can be a number, a length, or a percentage.

NOTE: This property does not work in either Netscape 7 or IE 6.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ๋ณด์‹œ์ฃ .

<p style="min-width:400px; height:100px;border:1px solid red;
             padding:5px; margin:10px;">
This paragraph is 100px high and min width is 400px
This paragraph is 100px high and min width is 400px
This paragraph is 100px high and min width is 400px
This paragraph is 100px high and min width is 400px
This paragraph is 100px high and min width is 400px
</p>
<img alt="logo" src="/images/css.gif" width="95" height="84" />

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. 

This paragraph is 100px high and min width is 400px This paragraph is 100px high and min width is 400px This paragraph is 100px high and min width is 400px This paragraph is 100px high and min width is 400px This paragraph is 100px high and min width is 400px

logo

 

 

 

 

๊ผญ ๋”ฐ๋ผํ•ด ๋ณด์‹œ๋Š” ๊ฒƒ ์žŠ์ง€ ๋งˆ์‹œ๊ณ , ์ด๊ฒƒ์ €๊ฒƒ ์ˆ˜์น˜๋„ ๋ฐ”๊ฟ”์„œ ํ•ด๋ณด์„ธ์š”. ^-^  

 

 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_dimension.htm 

 

 

 

 

์ด๋ฒˆ์—๋Š” ์™ธ๊ณฝ์„  ์†์„ฑ์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

์•„์›ƒ๋ผ์ธ(์™ธ๊ณฝ์„ )์€ ํ…Œ๋‘๋ฆฌ์™€ ๋งŽ์ด ์œ ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์ค€๋น„ํ–ˆ์Šต๋‹ˆ๋‹ค. 

 

์ด ๋‘๊ฐœ์˜ ์ฐจ์ด์ :

  • ์™ธ๊ณฝ์„ ์€ ๊ณต๊ฐ„์„ ์ฐจ์ง€ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

  • ์™ธ๊ณฝ์„ ์€ ์ง์‚ฌ๊ฐํ˜•์ผ ํ•„์š”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.

  • ์™ธ๊ณฝ์„ ์€ ์‚ฌ๋ฐฉ์ด ๋ชจ๋‘ ๋˜‘๊ฐ™์€ ์„ ์ž…๋‹ˆ๋‹ค. ํ…Œ๋‘๋ฆฌ์ฒ˜๋Ÿผ ์™ผ์ชฝ์€ ์ ์„ , ์˜ค๋ฅธ์ชฝ์€ ์ง์„ , ์ด๋ ‡๊ฒŒ ๋”ฐ๋กœ ์„ค์ •ํ•  ์ˆ˜๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.

NOTE: ์ด ์†์„ฑ๋„ IE 6 ์ด๋‚˜ Netscape 7์—์„œ๋Š” ์•ˆ๋œ๋‹ค๊ณ  ํ•˜๋Š”๊ตฐ์š”. ์•„์ง๋„ ์ด๋Ÿฐ ๋ธŒ๋ผ์šฐ์ €๋ฅผ ์‚ฌ์šฉํ•˜์‹œ๋Š” ๋ถ„๋“ค์€ ์—†๊ฒ ์ง€๋งŒ์š” ใ…‹ 

 

์ž ๊ทธ๋Ÿผ ์™ธ๊ณฝ์„  ๊ด€๋ จ ์†์„ฑ์— ์–ด๋–ค๊ฒƒ๋“ค์ด ์žˆ๋Š”์ง€ ํ•œ๋ฒˆ ์•Œ์•„๋ด…์‹œ๋‹ค. 

  •  outline-width

  •  outline-style  

  •  outline-color  

  •  outline  


The outline-width Property:

The outline-width property specifies the width of the outline to be added to the box. Its value should be a length or one of the values thin, medium, or thick . just like the border-width attribute

A width of zero pixels means no outline.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณด์‹œ์ฃ . 

<p style="outline-width:thin; outline-style:solid;">
This text is having thin outline.
</p>
<br />
<p style="outline-width:thick; outline-style:solid;">
This text is having thick outline.
</p>
<br />
<p style="outline-width:5px; outline-style:solid;">
This text is having 5x outline.
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

This text is having thin outline.


This text is having thick outline.


This text is having 5x outline.

 


The outline-style Property:

The outline-style property specifies the style for the line (solid, dotted, or dashed) that goes around an element. It can take one of the following values:

  • none: No border. (Equivalent of outline-width:0;)

  • solid: Outline is a single solid line.

  • dotted: Outline is a series of dots.

  • dashed: Outline is a series of short lines.

  • double: Outline is two solid lines.

  • groove: Outline looks as though it is carved into the page.

  • ridge: Outline looks the opposite of groove.

  • inset: Outline makes the box look like it is embedded in the page.

  • outset: Outline makes the box look like it is coming out of the canvas.

  • hidden: Same as none.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณด์‹œ์ฃ .

<p style="outline-width:thin; outline-style:solid;">
This text is having thin solid  outline.
</p>
<br />
<p style="outline-width:thick; outline-style:dashed;">
This text is having thick dashed outline.
</p>
<br />
<p style="outline-width:5px;outline-style:dotted;">
This text is having 5x dotted outline.
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

This text is having thin solid outline.


This text is having thick dashed outline.


This text is having 5x dotted outline.

 


The outline-color Property:

The outline-color property allows you to specify the color of the outline. Its value should either be a color name, a hex color, or an RGB value, as with the color and border-color properties.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณด์‹œ์ฃ .

<p style="outline-width:thin; outline-style:solid;
             outline-color:red">
This text is having thin solid red  outline.
</p>
<br />
<p style="outline-width:thick; outline-style:dashed;
             outline-color:#009900">
This text is having thick dashed green outline.
</p>
<br />
<p style="outline-width:5px;outline-style:dotted;
             outline-color:rgb(13,33,232)">
This text is having 5x dotted blue outline.
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

This text is having thin solid red outline.


This text is having thick dashed green outline.


This text is having 5x dotted blue outline.

 


The outline Property:

The outline property is a shorthand property that allows you to specify values for any of the three properties discussed previously in any order but in a single statement.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณด์‹œ์ฃ .

<p style="outline:thin solid red;">
This text is having thin solid red outline.
</p>
<br />
<p style="outline:thick dashed #009900;">
This text is having thick dashed green outline.
</p>
<br />
<p style="outline:5px dotted rgb(13,33,232);">
This text is having 5x dotted blue outline.
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

This text is having thin solid red outline.


This text is having thick dashed green outline.


This text is having 5x dotted blue outline.

 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_outlines.htm 

 

 

 

 

CSS์—์„œ๋Š” ์ปค์„œ์˜ ๋ชจ์–‘์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋Š” cursor ์†์„ฑ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. 

์ด ์†์„ฑ์€ submit๋ฒ„ํŠผ์„ ๋ˆ„๋ฅผ๋•Œ ๋งˆ์น˜ ๋งํฌ๊ฐ€ ๊ฑธ๋ ค์žˆ์„ ๋•Œ ์†๊ฐ€๋ฝ์ด ๋ณด์ด๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ์„ค์ •์„ ํ•ด์ค„ ์ˆ˜ ์žˆ๋„๋ก ํ•ด์ค๋‹ˆ๋‹ค.  

 

์•„๋ž˜ ํ…Œ์ด๋ธ”์—๋Š” ์ปค์„œ ์†์„ฑ์ด ๊ฐ€์งˆ ์ˆ˜ ์žˆ๋Š” ๊ฐ’๋“ค์— ๋Œ€ํ•œ ์„ค๋ช…์ด ๋‚˜์™€์žˆ์Šต๋‹ˆ๋‹ค.

ValueDescription
autoShape of the cursor depends on the context area it is over. For example an I over text, a hand over a link, and so on...
crosshairA crosshair or plus sign
defaultAn arrow
pointerA pointing hand (in IE 4 this value is hand)
moveThe I bar
e-resizeThe cursor indicates that an edge of a box is to be moved right (east)
ne-resizeThe cursor indicates that an edge of a box is to be moved up and right (north/east)
nw-resizeThe cursor indicates that an edge of a box is to be moved up and left (north/west)
n-resizeThe cursor indicates that an edge of a box is to be moved up (north)
se-resizeThe cursor indicates that an edge of a box is to be moved down and right (south/east)
sw-resizeThe cursor indicates that an edge of a box is to be moved down and left (south/west)
s-resizeThe cursor indicates that an edge of a box is to be moved down (south)
w-resizeThe cursor indicates that an edge of a box is to be moved left (west)
textThe I bar
waitAn hour glass
helpA question mark or balloon, ideal for use over help buttons
<url>The source of a cursor image file

 

๊ทธ๋Ÿผ ๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณด๋„๋ก ํ•˜์ฃ .

<p>๊ฐ ์†์„ฑ๊ฐ’ ๋ช…์นญ ์œ„์— ๋งˆ์šฐ์Šค๋ฅผ ์˜ฌ๋ ค๋ณด์„ธ์š”. ๋งˆ์šฐ์Šค ์ปค์„œ๋ชจ์–‘์ด ๋ณ€ํ•˜๋Š” ๊ฒƒ์„ ๋ณด์‹ค ์ˆ˜ ์žˆ์„ ๊ฒ๋‹ˆ๋‹ค.</p>
<div style="cursor:auto">Auto</div>
<div style="cursor:crosshair">Crosshair</div>
<div style="cursor:default">Default</div>
<div style="cursor:pointer">Pointer</div>
<div style="cursor:move">Move</div>
<div style="cursor:e-resize">e-resize</div>
<div style="cursor:ne-resize">ne-resize</div>
<div style="cursor:nw-resize">nw-resize</div>
<div style="cursor:n-resize">n-resize</div>
<div style="cursor:se-resize">se-resize</div>
<div style="cursor:sw-resize">sw-resize</div>
<div style="cursor:s-resize">s-resize</div>
<div style="cursor:w-resize">w-resize</div>
<div style="cursor:text">text</div>
<div style="cursor:wait">wait</div>
<div style="cursor:help">help</div>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๊ฐ ์†์„ฑ๊ฐ’ ๋ช…์นญ ์œ„์— ๋งˆ์šฐ์Šค๋ฅผ ์˜ฌ๋ ค๋ณด์„ธ์š”. ๋งˆ์šฐ์Šค ์ปค์„œ๋ชจ์–‘์ด ๋ณ€ํ•˜๋Š” ๊ฒƒ์„ ๋ณด์‹ค ์ˆ˜ ์žˆ์„ ๊ฒ๋‹ˆ๋‹ค.
Auto
Crosshair
Default
Pointer
Move
e-resize
ne-resize
nw-resize
n-resize
se-resize
sw-resize
s-resize
w-resize
text
wait
help

 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_cursors.htm 

 

 

 

 

๐Ÿ’ป Programming/CSS

[CSS] 15. Paddings ( ํŒจ๋”ฉ )

์ด๋ฒˆ์—๋Š” ํŒจ๋”ฉ์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ํŒจ๋”ฉ์€ ๋‚ด์šฉ๊ณผ ํ…Œ๋‘๋ฆฌ ์‚ฌ์ด์˜ ๊ฐ„๊ฒฉ์„ ๋งํ•ฉ๋‹ˆ๋‹ค. ์ด์ „์— ์—ฌ๋ฐฑ( ๋˜๋Š” ๋งˆ์ง„)์— ๋Œ€ํ•ด์„œ ๊ณต๋ถ€ํ•œ ์ ์ด ์žˆ์—ˆ์ฃ ? ๋งˆ์ง„๊ณผ ํŒจ๋”ฉ์˜ ์ฐจ์ด๊ฐ€ ๋ฌด์—‡์ธ์ง€ ์•„์‹œ๊ฒ ์ฃ ? ์ž˜ ๋ชจ๋ฅด์‹œ๊ฒ ๋‹ค๊ตฌ์š”? ๊ทธ๋Ÿผ ์ผ๋‹จ ํŒจ๋”ฉ ๊ด€๋ จ๋œ ์†์„ฑ์—๋Š” ์–ด๋–ค ๊ฒƒ๋“ค์ด ์žˆ๋Š”์ง€ ํ•œ๋ฒˆ ๋ณด๋„๋ก ํ•ฉ์‹œ๋‹ค. ํŒจ๋”ฉ ์†์„ฑ์— ๋Œ€ํ•œ ์†์„ฑ๊ฐ’์€ ๊ธธ์ด, ํผ์„ผํ‹ฐ์ง€, ๋˜๋Š” inherit์ž…๋‹ˆ๋‹ค.  inherit ๋Š” ๋ถ€๋ชจ์˜ ๊ทธ ๊ฐ’๊ณผ ๋™์ผํ•˜๊ฒŒ ํ•œ๋‹ค๋Š” ์˜๋ฏธ์ž…๋‹ˆ๋‹ค.ํผ์„ผํ‹ฐ์ง€ ๊ฐ’์ด ์‚ฌ์šฉ๋˜์—ˆ๋‹ค๋ฉด ๋‚ด์šฉ๋ฌผ์ด ๋“ค์–ด์žˆ๋Š” ์ปจํ…ํŠธ ๋ฐ•์Šค ์•ˆ์—์„œ์˜ ํผ์„ผํ‹ฐ์ง€์ž…๋‹ˆ๋‹ค.

๋‹ค์Œ์€ ํŒจ๋”ฉ๊ด€๋ จ ์†์„ฑ๋“ค ์ž…๋‹ˆ๋‹ค.

  • padding-bottom  

  • padding-top  

  • padding-left  

  • padding-right  

  • padding  

๊ทธ๋Ÿผ ์ด์ œ ๊ฐ ์†์„ฑ์— ๋Œ€ํ•œ ์˜ˆ์ œ๋ฅผ ๋ณด๋Ÿฌ ๊ฐ€ ๋ด…์‹œ๋‹ค~~~ Go Go Go ~


The padding-bottom Property:

The padding-bottom property sets the bottom padding (space) of an element. This can take a value in terms of length of %.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณผ๊นŒ์š”. 

<p style="padding-bottom: 15px; border:1px solid black;">
This is a paragraph with a specified bottom padding
</p>

<p style="padding-bottom: 5%; border:1px solid black;">
This is another paragraph with a specified bottom padding in percent
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

This is a paragraph with a specified bottom padding

This is another paragraph with a specified bottom padding in percent

 


The padding-top Property:

The padding-top property sets the top padding (space) of an element. This can take a value in terms of length of %.

 

๋‹ค์Œ ์˜ˆ์ œํ•œ๋ฒˆ ๋ณผ๊นŒ์š”.

<p style="padding-top: 15px; border:1px solid black;">
This is a paragraph with a specified top padding
</p>

<p style="padding-top: 5%; border:1px solid black;">
This is another paragraph with a specified top padding in percent
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

This is a paragraph with a specified top padding

This is another paragraph with a specified top padding in percent

 


The padding-left Property:

The padding-left property sets the left padding (space) of an element. This can take a value in terms of length of %.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณผ๊นŒ์š”.

<p style="padding-left: 15px; border:1px solid black;">
This is a paragraph with a specified left padding
</p>

<p style="padding-left: 15%; border:1px solid black;">
This is another paragraph with a specified left padding in percent
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

This is a paragraph with a specified left padding

This is another paragraph with a specified left padding in percent

 


The padding-right Property:

The padding-right property sets the right padding (space) of an element. This can take a value in terms of length of %.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณผ๊นŒ์š”.

<p style="padding-right: 15px; border:1px solid black;">
This is a paragraph with a specified right padding
</p>

<p style="padding-right: 5%; border:1px solid black;">
This is another paragraph with a specified right padding in percent
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

This is a paragraph with a specified right padding

This is another paragraph with a specified right padding in percent

 


The padding Property:

The padding property sets the left, right, top and bottom padding (space) of an element. This can take a value in terms of length of %.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณผ๊นŒ์š”.

<p style="padding: 15px; border:1px solid black;">
all four padding will be 15px
</p>

<p style="padding:10px 2%; border:1px solid black;">
top and bottom padding will be 10px, left and right padding will be 2% of the total width of the document.
</p>

<p style="padding: 10px 2% 10px; border:1px solid black;"> top padding will be 10px, left and right padding will be 2% of the total width of the document, bottom padding will be 10px </p>

<p style="padding: 10px 2% 10px 10px; border:1px solid black;"> top padding will be 10px, right padding will be 2% of the total width of the document, bottom padding and top padding will be 10px
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

all four paddings will be 15px

top and bottom paddings will be 10px, left and right paddings will be 2% of the total width of the document.

top padding will be 10px, left and right padding will be 2% of the total width of the document, bottom padding will be 10px

top padding will be 10px, right padding will be 2% of the total width of the document, bottom padding and top padding will be 10px

 

 

 

 

 

 

Reference :  http://www.tutorialspoint.com/css/css_padding.htm

 

 

 

 

์ด๋ฒˆ์—๋Š” ๋ชฉ๋ก๊ณผ ๊ด€๋ จ๋œ CSS์†์„ฑ์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. 

์šฐ์„  ์–ด๋–ค ์†์„ฑ๋“ค์ด ์žˆ๋Š”์ง€ ๊ทธ๋†ˆ๋“ค์˜ ์ด๋ฆ„๋ถ€ํ„ฐ ํ•œ๋ฒˆ ์‚ดํŽด๋ด…์‹œ๋‹ค. 

  • list-style-type ์ด๊ฑด ๋ชฉ๋ก ์Šคํƒ€์ผ, ์˜ˆ๋ฅผ ๋“ค๋ฉด ์ˆซ์ž, ์˜๋ฌธ, ๋™๊ทธ๋ผ๋ฏธ, ์‚ฌ๊ฐํ˜• , ๋ญ ์ด๋Ÿฐ ๊ฒƒ๋“ค์„ ์„ค์ •ํ•˜๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค. 

  • list-style-position ์ด๊ฑด ๋ชฉ๋ก์ด ์ธ๋ดํŠธ ๋˜์–ด์•ผ ํ•˜๋Š”์ง€๋ฅผ ๊ฒฐ์ •ํ•˜๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค. ํ•˜์œ„ ๋ชฉ๋ก์ด๋ƒ ์•„๋‹ˆ๋ƒ ๋ญ ์ด๋Ÿฐ๊ฑฐ์ฃ . 

  • list-style-image ๋ชฉ๋ก ์•ž์— ์ด๋ฏธ์ง€๋ฅผ ๋ณด์—ฌ์ฃผ๊ฒ ๋‹ค๋Š” ๊ฒ๋‹ˆ๋‹ค. ๋‹จ์ˆœํ•œ ์ˆซ์ž๋ชฉ๋ก์ด๋‚˜ ๊ธฐํ˜ธ๋ชฉ๋ก์ด ์‹ซ๋‹ค๋ฉด ์ด๊ฑธ ์“ธ ์ˆ˜๋„ ์žˆ๊ฒ ๋„ค์š”.

  • list-style ๋ชฉ๋ก ๊ด€๋ จ ์Šคํƒ€์ผ์„ ํ•œ๊บผ๋ฒˆ์— ์ •์˜ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ๋Š” ์†์„ฑ์ด์ฃ .

  • marker-offset ๋ชฉ๋ก์—์„œ ๋งˆ์ปค(์ˆซ์ž, ๋™๊ธ€๋ผ๋ฏธ ๋“ฑ๋“ฑ)์™€ ํ…์ŠคํŠธ ์‚ฌ์ด์˜ ๊ฐ„๊ฒฉ์„ ๊ฒฐ์ •์ง“๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค.

์ด์ œ ๊ฐ ์†์„ฑ๋“ค์„ ์–ด๋–ป๊ฒŒ ์‚ฌ์šฉํ•˜๋Š”์ง€ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณผ๊นŒ์š”?? 


The list-style-type Property:

list-style-type ์†์„ฑ์€ ๋ญ ๋ชฉ๋ก์— ๋ณด์—ฌ์ง€๋Š” ๋งˆ์ปค์˜ ์Šคํƒ€์ผ์„ ๋ณ€๊ฒฝํ•˜๊ธฐ์œ„ํ•œ ์†์„ฑ์ž…๋‹ˆ๋‹ค. 

๋ชฉ๋ก์—๋Š” ํฌ๊ฒŒ ์ˆœ์„œ์žˆ๋Š” ๋ชฉ๋ก๊ณผ ์ˆœ์„œ์—†๋Š” ๋ชฉ๋ก์ด ์žˆ์ฃ .

 

๋‹ค์Œ์€ ์ˆœ์„œ์—†๋Š” ๋ชฉ๋ก์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” list-style-type์˜ ์†์„ฑ๊ฐ’์ž…๋‹ˆ๋‹ค. 

ValueDescription
noneNA
disc (default)A filled-in circle
circleAn empty circle
squareA filled-in square

 

๋‹ค์Œ์€ ์ˆœ์„œ์žˆ๋Š” ๋ชฉ๋ก์—์„œ ์‚ฌ์šฉ๋˜๋Š” ์†์„ฑ๊ฐ’์ž…๋‹ˆ๋‹ค. 

ValueDescriptionExample
decimalNumber1,2,3,4,5
decimal-leading-zero0 before the number01, 02, 03, 04, 05
lower-alphaLowercase alphanumeric charactersa, b, c, d, e
upper-alphaUppercase alphanumeric charactersA, B, C, D, E
lower-romanLowercase Roman numeralsi, ii, iii, iv, v
upper-roman Uppercase Roman numeralsI, II, III, IV, V
lower-greek The marker is lower-greek alpha, beta, gamma
lower-latin The marker is lower-latin a, b, c, d, e
upper-latin The marker is upper-latin A, B, C, D, E
hebrew The marker is traditional Hebrew numbering  
armenian The marker is traditional Armenian numbering  
georgian The marker is traditional Georgian numbering  
cjk-ideographicThe marker is plain ideographic numbers 
hiraganaThe marker is hiraganaa, i, u, e, o, ka, ki
katakanaThe marker is katakanaA, I, U, E, O, KA, KI
hiragana-irohaThe marker is hiragana-irohai, ro, ha, ni, ho, he, to
katakana-irohaThe marker is katakana-irohaI, RO, HA, NI, HO, HE, TO

 

 

์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณผ๊นŒ์š”. 

<ul style="list-style-type:circle;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<ul style="list-style-type:square;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<ol style="list-style-type:decimal;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

<ol style="list-style-type:lower-alpha;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

<ol style="list-style-type:lower-roman;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. 

  • Maths
  • Social Science
  • Physics
  • Maths
  • Social Science
  • Physics
  1. Maths
  2. Social Science
  3. Physics
  1. Maths
  2. Social Science
  3. Physics
  1. Maths
  2. Social Science
  3. Physics

 


The list-style-position Property:

list-style-position ์†์„ฑ์€ bullet point๋ฅผ ํฌํ•จํ•˜๋Š” ๋ฐ•์Šค์˜ ๋‚ด๋ถ€ ๋˜๋Š” ์™ธ๋ถ€์˜ ์œ„์น˜๋ฅผ ์ง€์ •ํ•˜๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค.

ValueDescription
noneNA
insideIf the text goes onto a second line, the text will wrap underneath the marker. It will also appear indented to where the text would have started if the list had a value of outside.
outsideIf the text goes onto a second line, the text will be aligned with the start of the first line (to the right of the bullet).

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ๋ณด์‹œ์ฃ .

<ul style="list-style-type:circle; list-stlye-position:outside;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<ul style="list-style-type:square;list-style-position:inside;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<ol style="list-style-type:decimal;list-stlye-position:outside;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

<ol style="list-style-type:lower-alpha;list-style-position:inside;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • Maths
  • Social Science
  • Physics
  • Maths
  • Social Science
  • Physics
  1. Maths
  2. Social Science
  3. Physics
  1. Maths
  2. Social Science
  3. Physics

 


The list-style-image Property:

list-style-image ์†์„ฑ์€ ์œ„์—์„œ ๋ง์”€๋“œ๋ฆฐ ๊ฒƒ์ฒ˜๋Ÿผ ์ด๋ฏธ์ง€ ํŒŒ์ผ์„ ์†Œ์Šค๋กœ ์ง€์ •ํ•˜์—ฌ ๋ชฉ๋ก์˜ ๋งˆ์ปค๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ๋” ํ•ด์ฃผ๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค.  

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ๋ณด์‹œ์ฃ .

<ul>
<li style="list-style-image: url(/images/bullet.gif);">Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<ol>
<li style="list-style-image: url(/images/bullet.gif);">Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. ( url์— ์–ด๋–ค ์ด๋ฏธ์ง€ ์†Œ์Šค์˜ ๊ฒฝ๋กœ๊ฐ€ ๋“ค์–ด๊ฐ€๋Š๋ƒ์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์ง€๋Š” ๊ฒฐ๊ณผ์ž…๋‹ˆ๋‹ค. ) 

  • Maths
  • Social Science
  • Physics
  1. Maths
  2. Social Science
  3. Physics

 


The list-style Property:

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ๋ณด์‹œ์ฃ . 

<ul style="list-style: inside square;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<ol style="list-style: outside upper-alpha;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • Maths
  • Social Science
  • Physics
  1. Maths
  2. Social Science
  3. Physics

 


The marker-offset Property:

์ด ์†์„ฑ์€ IE 6, Netscape 7 ์ดํ•˜์—์„œ๋Š” ์ง€์›ํ•˜์ง€ ์•Š๋Š”๋‹ค๋Š”๊ตฐ์š”.

์˜ˆ์ œ๋ฅผ ๋ด…์‹œ๋‹ค. 

<ul style="list-style: inside square; marker-offset:2em;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<ol style="list-style: outside upper-alpha; marker-offset:2cm;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • Maths
  • Social Science
  • Physics
  1. Maths
  2. Social Science
  3. Physics

 

 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_lists.htm

 

 

 

 

margin ์†์„ฑ์€ HTML ์š”์†Œ์˜ ์ฃผ๋ณ€ ๊ณต๊ฐ„์„ ์กฐ์ ˆํ•ฉ๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ์ปจํ…ํŠธ์™€ ์˜ค๋ฒ„๋ž˜ํ•‘ ํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ์Œ์ˆ˜๊ฐ’์„ ์‚ฌ์šฉํ•œ๋‹ค๋ฉด ๋ง์ด์ฃ .

์ด ์†์„ฑ์˜ ๊ฐ’์€ ์ž์‹ ์š”์†Œ์—๊ฒŒ ์ƒ์†๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ฃผ์˜ํ•  ์ ์€ ๋ถ™์–ด์žˆ๋Š” ๋‘ ์š”์†Œ๊ฐ„์˜ top, bottom ๋งˆ์ง„์˜ ๊ฒฝ์šฐ ์ค‘๋ณต ์ ์šฉ์ด ๋˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ํฐ ์ˆซ์ž๋งŒ ์ ์šฉ์ด ๋œ๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ด๊ฒŒ ๋ฌด์Šจ ๋ง์ด๋ƒ๊ณ ์š”? ์ฒœ์ฒœํžˆ ์˜ˆ์ œ๋ฅผ ๋”ฐ๋ผ๊ฐ€๋ณด๋„๋ก ํ•ด๋ณด์„ธ์š”.

๋‹ค์Œ์€ ์—ฌ๋ฐฑ ๊ด€๋ จ ์†์„ฑ์ž…๋‹ˆ๋‹ค.

  • margin 

  • margin-bottom  

  • margin-top  

  • margin-left  

  • margin-right  

์ด์ œ ํ•˜๋‚˜ํ•˜๋‚˜ ์˜ˆ์ œ๋ฅผ ํ†ตํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ• ๊นŒ์š”? 


The margin Property:

ํ•œ๋ฐฉ์— ๋๋‚ด๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค. ๋ชจ๋“  ๋งˆ์ง„ ๊ด€๋ จ๋œ ์†์„ฑ๊ฐ’์„ ๋„ฃ์–ด์„œ ํ•œ๋ฒˆ์— ์„ค์ •์„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์•„๋ž˜๋Š” p ํƒœ๊ทธ ์ฃผ๋ณ€์— ๋งˆ์ง„์„ ์„ค์ •ํ•  ๋•Œ์˜ ๋งˆ์ง„ ์†์„ฑ ์‚ฌ์šฉ๋ฒ•์ž…๋‹ˆ๋‹ค. 

<style type="text/css">
p {margin: 15px}
all four margins will be 15px

p {margin: 10px 2%}
top and bottom margin will be 10px, left and right margin will be 2% of the total width of the document.

p {margin: 10px 2% -10px}
top margin will be 10px, left and right margin will be 2% of the total width of the document, bottom margin will be -10px

p {margin: 10px 2% -10px auto}
top margin will be 10px, right margin will be 2% of the total width of the document, bottom margin will be -10px, left margin will be set by the browser

</style>

 

์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณด์‹œ์ฃ . 

<p style="margin: 15px; border:1px solid black;">
all four margins will be 15px
</p>

<p style="margin:10px 2%; border:1px solid black;">
top and bottom margin will be 10px, left and right margin will be 2% of the total width of the document.
</p>

<p style="margin: 10px 2% -10px; border:1px solid black;"> top margin will be 10px, left and right margin will be 2% of the total width of the document, bottom margin will be -10px </p>

<p style="margin: 10px 2% -10px auto; border:1px solid black;"> top margin will be 10px, right margin will be 2% of the total width of the document, bottom margin will be -10px, left margin will be set by the browser
</p>

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

all four margins will be 10px

top and bottom margin will be 10px, left and right margin will be 2% of the total width of the document.

top margin will be 10px, left and right margin will be 2% of the total width of the document, bottom margin will be -10px

top margin will be 10px, right margin will be 2% of the total width of the document, bottom margin will be -10px, left margin will be set by the browser

 


The margin-bottom Property:

์ด๊ฑด ๋ญ ๋ง ์•ˆํ•ด๋„ ์•„๋ž˜์กฑ ๋งˆ์ง„ ์†์„ฑ์ด๋ผ๋Š” ๊ฒƒ์„ ์•„์‹ค๊ฒ๋‹ˆ๋‹ค. ์†์„ฑ๊ฐ’์œผ๋กœ๋Š” length, % ๋˜๋Š” auto ๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

<p style="margin-bottom: 15px; border:1px solid black;">
This is a paragraph with a specified bottom margin
</p>

<p style="margin-bottom: 5%; border:1px solid black;">
This is another paragraph with a specified bottom margin in percent
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

This is a paragraph with a specified bottom margin

This is another paragraph with a specified bottom margin in percent

 


The margin-top Property:

์œ„์™€ ๋™์ผํ•ฉ๋‹ˆ๋‹ค.
<p style="margin-top: 15px; border:1px solid black;">
This is a paragraph with a specified top margin
</p>

<p style="margin-top: 5%; border:1px solid black;">
This is another paragraph with a specified top margin in percent
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

This is a paragraph with a specified top margin

This is another paragraph with a specified top margin in percent

 


The margin-left Property:

์œ„์™€ ๋™์ผํ•ฉ๋‹ˆ๋‹ค.
<p style="margin-left: 15px; border:1px solid black;">
This is a paragraph with a specified left margin
</p>

<p style="margin-left: 5%; border:1px solid black;">
This is another paragraph with a specified top margin in percent
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. 

This is a paragraph with a specified left margin

This is another paragraph with a specified top margin in percent



The margin-right Property:

์œ„์™€ ๋™์ผํ•ฉ๋‹ˆ๋‹ค.
<p style="margin-right: 15px; border:1px solid black;">
This is a paragraph with a specified right margin
</p>

<p style="margin-right: 5%; border:1px solid black;">
This is another paragraph with a specified right margin in percent
</p>

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. 

This is a paragraph with a specified right margin

This is another paragraph with a specified right margin in percent

 

 

 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_margins.htm 

 

 

 

 

์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” ํ…Œ๋‘๋ฆฌ์— ๋Œ€ํ•œ ์†์„ฑ๋“ค์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

  • border-color ํ…Œ๋‘๋ฆฌ ์ƒ‰์ƒ์„ ์„ค์ •ํ•˜๋Š” ์†์„ฑ์ด์ฃ . 

  • border-style ํ…Œ๋‘๋ฆฌ ์Šคํƒ€์ผ์„ ๊ฒฐ์ •์ง“๋Š” ์†์„ฑ์ด๋„ค์š”.

  • border-width ํ…Œ๋‘๋ฆฌ ๋‘๊ป˜๋ฅผ ์„ค์ •ํ•˜๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค. 

๋Š˜ ๊ทธ๋ ‡๋“ฏ์ด ์—ญ์‹œ ์˜ˆ์ œ๋ฅผ ๋ณด๋Š”๊ฒŒ ๋นจ๋ฆฌ ๋ฐฐ์šฐ๋Š” ์ง€๋ฆ„๊ธธ์ด์ฃ .  

 

์‹œ์ž‘ํ•ด ๋ณผ๊นŒ์š”?? 

The border-color Property:

ํ…Œ๋‘๋ฆฌ ์ƒ‰์ƒ์„ ๋ณ€๊ฒฝํ•  ๋•Œ๋Š” ์‚ฌ๋ฐฉ์„ ํ•œ๊บผ๋ฒˆ์— ๋ณ€๊ฒฝํ•  ์ˆ˜๋„ ์žˆ๊ฒ ์ง€๋งŒ ๋ฐฉํ–ฅ๋งˆ๋‹ค ๋‹ค๋ฅด๊ฒŒ ์ƒ‰์ƒ์„ ์ง€์ •ํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์€ ์†์„ฑ๋“ค์„ ์ด์šฉํ•ด์„œ ๋ง์ด์ฃ .

  • border-bottom-color

  • border-top-color 

  • border-left-color 

  • border-right-color 

์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณผ๊นŒ์š”?? 

<style type="text/css">
p.example1{
   border:1px solid;
   border-bottom-color:#009900; /* Green */
   border-top-color:#FF0000;    /* Red */
   border-left-color:#330000;   /* Black */
   border-right-color:#0000CC;  /* Blue */
}
p.example2{
   border:1px solid;
   border-color:#009900;        /* Green */
}
</style>
<p class="example1">
This example is showing all borders in different colors.
</p>
<p class="example2">
This example is showing all borders in green color only.
</p>

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

 

 

The border-style Property:

ํ…Œ๋‘๋ฆฌ ์Šคํƒ€์ผ์„ ๋‚ด ๋งˆ์Œ๋Œ€๋กœ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ…Œ๋‘๋ฆฌ ์Šคํƒ€์ผ์˜ ์ข…๋ฅ˜๋กœ๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ ๊ฒƒ๋“ค์ด ์žˆ์Šต๋‹ˆ๋‹ค.

  • none: No border. (Equivalent of border-width:0;)

  • solid: Border is a single solid line.

  • dotted: Border is a series of dots.

  • dashed: Border is a series of short lines.

  • double: Border is two solid lines.

  • groove: Border looks as though it is carved into the page.

  • ridge: Border looks the opposite of groove.

  • inset: Border makes the box look like it is embedded in the page.

  • outset: Border makes the box look like it is coming out of the canvas.

  • hidden: Same as none, except in terms of border-conflict resolution for table elements.

ํ…Œ๋‘๋ฆฌ ์Šคํƒ€์ผ ์—ญ์‹œ ๋ฐฉํ–ฅ์— ๋”ฐ๋ผ ๊ฐ๊ธฐ ๋‹ค๋ฅธ ์Šคํƒ€์ผ์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜ ์†์„ฑ๋“ค์„ ์ด์šฉํ•ด์„œ ๋ง์ด์ฃ . 

  • border-bottom-style 

  • border-top-style 

  • border-left-style 

  • border-right-style 

์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณด์‹œ์ฃ . 

<p style="border-width:4px; border-style:none;">
This is a border with none width.
</p>
<p style="border-width:4px; border-style:solid;">
This is a solid border.
</p>
<p style="border-width:4px; border-style:dashed;">
This is a dahsed border.
</p>
<p style="border-width:4px; border-style:double;">
This is a double border.
</p>
<p style="border-width:4px; border-style:groove;">
This is a groove border.
</p>
<p style="border-width:4px; border-style:ridge">
This is aridge  border.
</p>
<p style="border-width:4px; border-style:inset;">
This is a inset border.
</p>
<p style="border-width:4px; border-style:outset;">
This is a outset border.
</p>
<p style="border-width:4px; border-style:hidden;">
This is a hidden border.
</p>
<p style="border-width:4px; 
             border-top-style:solid;
             border-bottom-style:dashed;
             border-left-style:groove;
             border-right-style:double;">
This is a a border with four different styles.
</p>

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

This is a border with none width.

This is a solid border.

This is a dahsed border.

This is a double border.

This is a groove border.

This is aridge border.

This is a inset border.

This is a outset border.

This is a hidden border.

This is a a border with four different styles.

 

 

The border-width Property:

ํ…Œ๋‘๋ฆฌ ๋‘๊ป˜๋ฅผ ๋‚ด ๋งˆ์Œ๋Œ€๋กœ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ๊ฒŒ๋” ํ•ด์ฃผ๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค. ๋‹จ์œ„๋กœ๋Š” px, pt, cm์„ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ๊ณ , ์ •๋„์— ๋”ฐ๋ผ thin, medium, ๋˜๋Š” thick ๊ฐ’์„ ์ง€์ •ํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ์†์„ฑ ์—ญ์‹œ ๋ฐฉํ–ฅ์— ๋”ฐ๋ผ ๊ฐ๊ฐ ๋ถ€์—ฌ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. 

  • border-bottom-width 

  • border-top-width 

  • border-left-width 

  • border-right-width 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณด์‹œ์ฃ . 

<p style="border-width:4px; border-style:solid;">
This is a solid border whose width is 4px.
</p>
<p style="border-width:4pt; border-style:solid;">
This is a solid border whose width is 4pt.
</p>
<p style="border-width:thin; border-style:solid;">
This is a solid border whose width is thin.
</p>
<p style="border-width:medium; border-style:solid;">
This is a solid border whose width is medium;
</p>
<p style="border-width:thick; border-style:solid;">
This is a solid border whose width is thick.
</p>
<p style="border-bottom-width:4px;
             border-top-width:10px;
             border-left-width: 2px;
             border-right-width:15px;
             border-style:solid;">
This is a a border with four different width.
</p>

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. 

This is a solid border whose width is 4px.

This is a solid border whose width is 4pt.

This is a solid border whose width is thin.

This is a solid border whose width is medium;

This is a solid border whose width is thick.

This is a a border with four different width.

 

 

Border Properties Using Shorthand:

์ง€๊ธˆ๊นŒ์ง€ ํ…Œ๋‘๋ฆฌ์˜ ์ƒ‰์ƒ, ์Šคํƒ€์ผ, ๊ทธ๋ฆฌ๊ณ  ๋‘๊ป˜์— ๋Œ€ํ•ด์„œ ์†์„ฑ๊ฐ’์„ ๋ณ€๊ฒฝํ•˜๋Š” ๋ฒ•์„ ๋ฐฐ์›Œ๋ณด์•˜์Šต๋‹ˆ๋‹ค.

 

๊ทธ๋Ÿฐ๋ฐ ํ•˜๋‚˜ํ•˜๋‚˜ ์ง€์ •ํ•ด์ฃผ๋ ค๋‹ˆ ์ข€ ๊ท€์ฐฎ์€ ๊ฐ์ด ์—†์ง€์•Š์•„ ์žˆ๋„ค์š”.

 

๊ทธ๋ž˜์„œ ์—ฌ๊ธฐ type less do more๋ฅผ ์‹ค์ฒœํ•˜๊ณ ์žˆ๋Š” ๋ฐฉ๋ฒ•์„ ํ•˜๋‚˜ ์†Œ๊ฐœํ•ด ๋“œ๋ฆฌ๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

 

๋‹ค์Œ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณด์‹ค๊นŒ์š”??

<p style="border:4px solid red;">
This example is showing shorthand property for border.
</p>

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. 

This example is showing shorthand property for border.

 

์œ„ ์ฒ˜๋Ÿผ ๋‘๊ป˜, ์Šคํƒ€์ผ, ์ƒ‰์ƒ ์†์„ฑ์„ ํ•œ๊บผ๋ฒˆ์— ์“ธ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์–ด๋•Œ์š”? ์™„์ „ ๊ฐ„๋‹จํ•˜์ฃ ? ^_^ 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_borders.htm

 

 

 

 

์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” CSS๋ฅผ ์ด์šฉํ•œ ํ…Œ์ด๋ธ” ๊ด€๋ จ ์†์„ฑ์„ ์„ค์ •ํ•˜๋Š” ๊ฒƒ์„ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

ํ…Œ์ด๋ธ” ๊ด€๋ จ ์†์„ฑ์—๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฒƒ๋“ค์ด ์žˆ์Šต๋‹ˆ๋‹ค. 

  • border-collapse

  • border-spacing 

  • caption-side 

  • empty-cells 

  • table-layout 

 

์ด์ œ ์ด ์†์„ฑ๋“ค์„ ์–ด๋–ป๊ฒŒ ์‚ฌ์šฉํ•˜๋Š”์ง€ ํ•œ๋ฒˆ ๋ณผ๊นŒ์š”??? ^-^ 

The border-collapse Property:

์ด ์†์„ฑ์€ ๋‹ค์Œ ๋‘๊ฐ€์ง€ ๊ฐ’์„ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. collapse ์™€ separate.  

๋‹ค์Œ์€ ๋‘ ๊ฐ€์ง€ ๊ฐ’์— ๋Œ€ํ•œ ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค. 

<style type="text/css">
table.one {border-collapse:collapse;}
table.two {border-collapse:separate;}
td.a {
      border-style:dotted; 
      border-width:3px; 
      border-color:#000000; 
      padding: 10px;
}
td.b {border-style:solid; 
      border-width:3px; 
      border-color:#333333; 
      padding:10px;
}
</style>
<table class="one">
<caption>Collapse Border Example</caption>
<tr><td class="a"> Cell A Collapse Example</td></tr>
<tr><td class="b"> Cell B Collapse Example</td></tr>
</table>
<br />
<table class="two">
<caption>Separate Border Example</caption>
<tr><td class="a"> Cell A Separate Example</td></tr>
<tr><td class="b"> Cell B Separate Example</td></tr>
</table>

์ง์ ‘ ํ…Œ์ŠคํŠธ ํ•ด๋ณด์„ธ์š”.

 

Collapse ์†์„ฑ๊ฐ’์„ ์ฃผ๊ฒŒ๋˜๋ฉด ํ…Œ์ด๋ธ” ๋‚ด์˜ ์…€๋“ค์˜ ๋ณด๋”๊ฐ€ ๋ถ™์–ด์žˆ์„ ๊ฒฝ์šฐ ํ•œ์ค„๋กœ ๋ณด์ด๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

๋ฐ˜๋Œ€๋กœ separate์†์„ฑ๊ฐ’์„ ์ฃผ๊ฒŒ๋˜๋ฉด ๋ถ™์–ด์žˆ๋Š” ๋‘ ์…€์˜ ๋ณด๋”๊ฐ€ ๋”ฐ๋กœ ๋–จ์–ด์ ธ์„œ ๋ณด์ด๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

 

 

 

The border-spacing Property:

์ด ์†์„ฑ์€ ๋ณด๋” ์‚ฌ์ด์˜ ๊ฐ„๊ฒฉ์„ ๋„์šฐ๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค. ์†์„ฑ๊ฐ’์œผ๋กœ๋Š” ํ•˜๋‚˜ ๋˜๋Š” ๋‘๊ฐœ์˜ ๊ฐ’์„ ๊ฐ€์งˆ ์ˆ˜ ์žˆ๊ณ , ์ด ๊ฐ’์€ ๊ธธ์ด์˜ ๋‹จ์œ„์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๊ฐ’์„ ํ•˜๋‚˜๋งŒ ์ค„ ๊ฒฝ์šฐ์—๋Š” ๊ฐ€๋กœ, ์„ธ๋กœ์— ๋™์ผํ•œ ๊ฐ’์ด ์ ์šฉ์ด ๋˜๋ฉฐ ๋‘๊ฐœ์˜ ๊ฐ’์„ ์ค„ ๊ฒฝ์šฐ์—๋Š” ์ฒซ์งธ๊ฐ’์ด ๊ฐ€๋กœ ์ŠคํŽ˜์ด์Šค, ๋‘๋ฒˆ์งธ ๊ฐ’์ด ์„ธ๋กœ ์ŠคํŽ˜์ด์Šค๋ฅผ ์œ„ํ•œ ๊ฐ’์œผ๋กœ ๊ฐ„์ฃผ๋ฉ๋‹ˆ๋‹ค.

NOTE: Netscape 7 ๋˜๋Š” IE 6 ์—์„œ๋Š” ์ ์šฉ๋˜์ง€ ์•Š๋Š”๋‹ค๊ณ  ํ•˜๋„ค์š”. ์•„์ง๋„ IE 6 ์‚ฌ์šฉํ•˜๋Š” ์‚ฌ๋žŒ์ด ์žˆ์„์ง€๋Š” ์˜๋ฌธ์ด์ง€๋งŒ์š”. 

<style type="text/css">
/* If you provide one value */
table.example {border-spacing:10px;}
/* This is how you can provide two values */
table.example {border-spacing:10px; 15px;}
</style>

์•ž์„œ ํ–ˆ๋˜ ์˜ˆ์ œ์˜ ์†Œ์Šค๋ฅผ ๋ณ€๊ฒฝํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. 

<style type="text/css">
table.one {
   border-collapse:separate;
   width:400px;
   border-spacing:10px;
}
table.two {
   border-collapse:separate;
   width:400px;
   border-spacing:10px 50px;
}
</style>
<table class="one" border="1">
<caption>Separate Border Example with border-spacing</caption>
<tr><td> Cell A Collapse Example</td></tr>
<tr><td> Cell B Collapse Example</td></tr>
</table>
<br />
<table class="two" border="1">
<caption>Separate Border Example with border-spacing</caption>
<tr><td> Cell A Separate Example</td></tr>
<tr><td> Cell B Separate Example</td></tr>
</table>

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

์ง์ ‘ ํ…Œ์ŠคํŠธ ํ•ด๋ณด๋Š” ๊ฒƒ ์žŠ์ง€ ๋งˆ์„ธ์š”. ๊ผญ ์ด์š”!!! ^-^ 

 

The caption-side Property:

์ด ์†์„ฑ์€ ์บก์…˜์„ ์–ด๋””์— ์œ„์น˜์‹œํ‚ฌ ๊ฒƒ์ธ์ง€์— ๋Œ€ํ•œ ์†์„ฑ์ž…๋‹ˆ๋‹ค. ์†์„ฑ๊ฐ’์œผ๋กœ๋Š” ๋‹ค์Œ ๋„ค๊ฐ€์ง€ ์ค‘ ํ•œ๊ฐœ๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. top, bottom, left or right.  ๊ทธ๋Ÿผ ๊ฐ๊ฐ์˜ ์˜ˆ์ œ๋ฅผ ํ•œ๋ฒˆ ๋ณผ๊นŒ์š”?? 

NOTE: IE ์—์„œ๋Š” ์ž‘๋™์„ ์•ˆํ•  ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ตฐ์š”.

<style type="text/css">
caption.top {caption-side:top}
caption.bottom {caption-side:bottom}
caption.left {caption-side:left}
caption.right {caption-side:right}
</style>

<table style="width:400px; border:1px solid black;">
<caption class="top">
This caption will appear at the top
</caption>
<tr><td > Cell A</td></tr>
<tr><td > Cell B</td></tr>
</table>
<br />

<table style="width:400px; border:1px solid black;">
<caption class="bottom">
This caption will appear at the bottom
</caption>
<tr><td > Cell A</td></tr>
<tr><td > Cell B</td></tr>
</table>
<br />

<table style="width:400px; border:1px solid black;">
<caption class="left">
This caption will appear at the left
</caption>
<tr><td > Cell A</td></tr>
<tr><td > Cell B</td></tr>
</table>
<br />

<table style="width:400px; border:1px solid black;">
<caption class="right">
This caption will appear at the right
</caption>
<tr><td > Cell A</td></tr>
<tr><td > Cell B</td></tr>
</table>

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

 

 

The empty-cells Property:

์ด ์†์„ฑ์€ ๋นˆ ์…€๊ณผ ๊ด€๋ จ๋œ ์†์„ฑ์ž…๋‹ˆ๋‹ค. ์†์„ฑ๊ฐ’์œผ๋กœ๋Š” show, hide, inherit ์ค‘์— ํ•˜๋‚˜๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. 

<style type="text/css">
table.empty{
    width:350px;
    border-collapse:separate;
    empty-cells:hide;
}
td.empty{
    padding:5px;
    border-style:solid;
    border-width:1px;
    border-color:#999999;
}
</style>
<table class="empty">
<tr>
<th></th>
<th>Title one</th>
<th>Title two</th>
</tr>
<tr>
<th>Row Title</th>
<td class="empty">value</td>
<td class="empty">value</td>
</tr>
<tr>
<th>Row Title</th>
<td class="empty">value</td>
<td class="empty"></td>
</tr>
</table>

 

 

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. 

 

 

 

The table-layout Property:

์ด ์†์„ฑ์€ ๋ธŒ๋ผ์šฐ์ €์— ํ…Œ์ด๋ธ”์„ ๋ณด์—ฌ์ค„ ๋•Œ ์–ด๋–ป๊ฒŒ ๋ณด์—ฌ์ค„ ๊ฒƒ์ธ์ง€๋ฅผ ์ปจํŠธ๋กค ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค. ์†์„ฑ๊ฐ’์œผ๋กœ๋Š” fixed, auto, ๋˜๋Š” inherit ์„ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์„ธ๊ฐ€์ง€ ๊ฐ’์— ๋Œ€ํ•œ ์ฐจ์ด์ ์„ ํ•œ๋ฒˆ ์•Œ์•„๋ณด๋„๋ก ํ•˜์ฃ . 

NOTE: ์ฐธ๊ณ ๋กœ ์ด ์†์„ฑ์€ ๋งŽ์€ ๋ธŒ๋ผ์šฐ์ €์—์„œ ์ง€์›ํ•˜์ง€ ์•Š๋Š”๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

<style type="text/css">
table.auto
{
table-layout: auto
}
table.fixed
{
table-layout: fixed
}
</style>
<table class="auto" border="1" width="100%">
<tr>
<td width="20%">1000000000000000000000000000</td>
<td width="40%">10000000</td>
<td width="40%">100</td>
</tr>
</table>
<br />
<table class="fixed" border="1" width="100%">
<tr>
<td width="20%">1000000000000000000000000000</td>
<td width="40%">10000000</td>
<td width="40%">100</td>
</tr>
</table>

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

 

 

 

๊ผญ ์Šค์Šค๋กœ ํ…Œ์ŠคํŠธ ํ•ด๋ณด๊ณ  ๊ฒฐ๊ณผ๋ฅผ ํ™•์ธํ•˜์„ธ์š”.  

 

๋ธŒ๋ผ์šฐ์ € ๋ณ„๋กœ ํ•ด๋ณด๊ณ  ๋ธŒ๋ผ์šฐ์ €์˜ ๋ฒ„์ „๋ณ„๋กœ ํ•ด๋ณด๊ณ  ์—ด์‹ฌํžˆ ๊ณต๋ถ€ํ•ด์•ผ ๊ณ ์ˆ˜๊ฐ€ ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_tables.htm

 

 

 

 

 

์ด๋ฒˆ์—๋Š” CSS๋ฅผ ์ด์šฉํ•œ ๋งํฌ ๊ด€๋ จ ์„ค์ •์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.  

 

  •  :link Signifies unvisited hyperlinks.

  •  :visited Signifies visited hyperlinks.

  •  :hover Signifies an element that currently has the user's mouse pointer hovering over it.

  •  :active Signifies an element on which the user is currently clicking.

์ด ๋งํฌ๊ด€๋ จ ์†์„ฑ์€ HTML๋ฌธ์„œ์˜ ํ—ค๋”๋ถ€๋ถ„์— ์ •์˜๋ฅผ ํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  a:hover์†์„ฑ์€ a:link ์™€ a:visited ๋‹ค์Œ์— ์™€์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  a:active์†์„ฑ์€ a:hover์†์„ฑ ๋‹ค์Œ์— ์™€์•ผ ํ•ฉ๋‹ˆ๋‹ค. 

<style type="text/css">
a:link {color: #000000}
a:visited {color: #006600}
a:hover {color: #FFCC00}
a:active {color: #FF00CC}
</style>

 

 

 

# ์ฐธ๊ณ ๋กœ ์•„๋ž˜ ์˜ˆ์ œ๋“ค์€ ๋„ค์ด๋ฒ„ ๋ธ”๋กœ๊ทธ ํŠน์„ฑ์ƒ ์Šคํƒ€์ผ์„ ๋จน์ง€ ์•Š๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฐœ์ธ์ ์œผ๋กœ html๋ฌธ์„œ๋ฅผ ๋งŒ๋“ค์–ด์„œ ํ…Œ์ŠคํŠธ ํ•ด๋ณด์‹œ๊ธฐ๋ฅผ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

 

 

๋งํฌ ๊ธฐ๋ณธ ์ƒ‰์ƒ ์„ค์ •

Following is the example which demonstrates how to set the link color. Possible value could be any color name in any valid format.

<style type="text/css">
a:link {color:#0000FF}
</style>
<a href="/html/index.htm">Black Link</a>

This will produce following black link:

Black Link

 

๋ฐฉ๋ฌธํ–ˆ๋˜ ๋งํฌ ์ƒ‰์ƒ ์„ค์ •

Following is the example which demonstrates how to set the color of visited links. Possible value could be any color name in any valid format.

<style type="text/css">
a:visited {color: #006600}
</style>
<a href="/html/index.htm">Click this link</a>

This will produce following link. Once you will click this link, it will change its color to green.

Click this link

 

๋งˆ์šฐ์Šค hover์‹œ ๋งํฌ ์ƒ‰์ƒ ์„ค์ •

Following is the example which demonstrates how to change the color of links when we bring a mouse pointer over that link. Possible value could be any color name in any valid format.

<style type="text/css">
a:hover {color: #FFCC00}
</style>
<a href="/html/index.htm">Bring Mouse Here</a>

This will produce following link. Now you bring your mouse over this link and you will see that it changes its color to yellow.

Bring Mouse Here

 

์•กํ‹ฐ๋ธŒ ๋งํฌ ์ƒ‰์ƒ ์„ค์ •

Following is the example which demonstrates how to change the color of active links. Possible value could be any color name in any valid format.

<style type="text/css">
a:active {color: #FF00CC}
</style>
<a href="/html/index.htm">Click This Link</a>

This will produce following link. This will change it color to pink when user clicks it.

Click This Link

 

 

 

 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_links.htm

 

 

 

 

 

 

 

์ด๋ฒˆ์—๋Š” CSS ๋ฅผ ์ด์šฉํ•œ ์ด๋ฏธ์ง€ ๊ด€๋ จ ์†์„ฑ์„ ์„ค์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. 

  • The border property is used to set the width of an image border.

  • The height property is used to set the height of an image.

  • The width property is used to set the width of an image.

  • The -moz-opacity property is used to set the opacity of an image.

image border ์†์„ฑ

The border property of an image is used to set the width of an image border. This property can have a value in length or in %.

A width of zero pixels means no border.

Here is the example:

<img style="border:0px;" src="/images/css.gif" />
<br />
<img style="border:3px dashed red;" src="/images/css.gif" />

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

CSS Logo

 

 

image height ์†์„ฑ

The height property of an image is used to set the height of an image. This property can have a value in length or in %. While giving value in %, it applies it in respect of the box in which an image is available.

Here is the example:

<img style="border:1px solid red; height:100px;" 
        src="/images/css.gif" />
<br />
<img style="border:1px solid red; height:50%;" 
        src="/images/css.gif" />

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.


 

 

image width ์†์„ฑ

The width property of an image is used to set the width of an image. This property can have a value in length or in %. While giving value in %, it applies it in respect of the box in which an image is available.

Here is the example:

<img style="border:1px solid red; width:100px;" 
        src="/images/css.gif" />
<br />
<img style="border:1px solid red; width:100%;" 
        src="/images/css.gif" />

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.


 

 

-moz-opacity ์†์„ฑ

 -moz-opacity ์†์„ฑ์€ ์ด๋ฏธ์ง€์˜ opacity๋ฅผ ์„ค์ •ํ•˜๊ธฐ์œ„ํ•œ ์†์„ฑ์ž…๋‹ˆ๋‹ค. ์ด ์†์„ฑ์€ Mozilla์—์„œ ์ด๋ฏธ์ง€์˜ ํˆฌ๋ช…๋„๋ฅผ ์„ค์ •ํ•˜๊ธฐ ์œ„ํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค. IE ๋Š” filter:alpha(opacity=x) ๋ฅผ ์‚ฌ์šฉํ•˜์ฃ .

Mozilla์—์„œ (-moz-opacity:x) ์†์„ฑ์„ ์‚ฌ์šฉํ•  ๋•Œ x ๊ฐ’์€ 0.0 ์—์„œ 1.0 ์„ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ˆซ์ž๊ฐ€ ๋‚ฎ์„ ์ˆ˜๋ก ๋” ํˆฌ๋ช…ํ•ด์ง€์ฃ .  

In IE (filter:alpha(opacity=x)) x can be a value from 0 - 100. A lower value makes the element more transparent.

Here is the example:

<img style="border:1px solid red;-moz-opacity:0.4;filter:alpha(opacity=40);opacity:0.4;" src="/images/css.gif" />

๊ฒฐ๊ณผ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

 

 

 

 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_images.htm