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

  • 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