์ด๋ฒ์๋ ํจ๋ฉ์ ๋ํด์ ์์๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค. ํจ๋ฉ์ ๋ด์ฉ๊ณผ ํ ๋๋ฆฌ ์ฌ์ด์ ๊ฐ๊ฒฉ์ ๋งํฉ๋๋ค. ์ด์ ์ ์ฌ๋ฐฑ( ๋๋ ๋ง์ง)์ ๋ํด์ ๊ณต๋ถํ ์ ์ด ์์์ฃ ? ๋ง์ง๊ณผ ํจ๋ฉ์ ์ฐจ์ด๊ฐ ๋ฌด์์ธ์ง ์์๊ฒ ์ฃ ? ์ ๋ชจ๋ฅด์๊ฒ ๋ค๊ตฌ์? ๊ทธ๋ผ ์ผ๋จ ํจ๋ฉ ๊ด๋ จ๋ ์์ฑ์๋ ์ด๋ค ๊ฒ๋ค์ด ์๋์ง ํ๋ฒ ๋ณด๋๋ก ํฉ์๋ค. ํจ๋ฉ ์์ฑ์ ๋ํ ์์ฑ๊ฐ์ ๊ธธ์ด, ํผ์ผํฐ์ง, ๋๋ 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
'๐ป Programming > CSS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[CSS] 17. Outlines ( ์ธ๊ณฝ์ , ์์๋ผ์ธ ) (0) | 2016.06.12 |
---|---|
[CSS] 16. Cursor ( ๋ง์ฐ์ค ์ปค์ ๋ชจ์ ) (0) | 2016.06.12 |
[CSS] 14. Lists ( ๋ฆฌ์คํธ, ๋ชฉ๋ก ) (0) | 2016.06.12 |
[CSS] 13. Margins ( ๋ง์ง, ์ฌ๋ฐฑ ) (0) | 2016.06.12 |
[CSS] 12. Borders ( ํ ๋๋ฆฌ, ๋ณด๋ ์ค์ ) (0) | 2016.06.12 |