πŸ’» Programming/CSS (28)

πŸ’» Programming/CSS

[CSS] 8. Text ( ν…μŠ€νŠΈ μ„€μ • )

μ΄λ²ˆμ—λŠ” CSS 속성을 μ΄μš©ν•΄μ„œ ν…μŠ€νŠΈλ₯Ό μ‘°μž‘ν•˜λŠ” 방법에 λŒ€ν•΄μ„œ μ•Œμ•„λ³΄κ² μŠ΅λ‹ˆλ‹€.

  • The color property is used to set the color of a text.

  • The direction property is used to set the text direction.

  • The letter-spacing property is used to add or subtract space between the letters that make up a word.

  • The word-spacing property is used to add or subtract space between the words of a sentence.

  • The text-indent property is used to indent the text of a paragraph.

  • The text-align property is used to align the text of a document.

  • The text-decoration property is used to underline, overline, and strikethrough text.

  • The text-transform property is used to capitalize text or convert text to uppercase or lowercase letters.

  • The white-space property is used to control the flow and formatting of text.

  • The text-shadow property is used to set the text shadow around a text.

 

ν…μŠ€νŠΈ 색깔 μ„€μ •

<p style="color:red;">
This text will be written in red.
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

This text will be written in red.

 

 

ν…μŠ€νŠΈ λ°©ν–₯ μ„€μ •

Following is the example which demonstrates how to set the direction of a text. Possible values are ltr or rtl.

<p style="direction:rtl;">
This text will be renedered from right to left
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

This text will be renedered from right to left

 

 

문자 μ‚¬μ΄μ˜ 곡간 μ„€μ •

Following is the example which demonstrates how to set the space between characters. Possible values are normal or a number specifying space..

<p style="letter-spacing:5px;">
This text is having space between letters.
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

This text is having space between letters.

 

 

단어 μ‚¬μ΄μ˜ 곡간 μ„€μ •

Following is the example which demonstrates how to set the space between words. Possible values are normal or a number specifying space..

<p style="word-spacing:5px;">
This text is having space between words.
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

This text is having space between words.

 

 

ν…μŠ€νŠΈ 인덴트 μ„€μ •

Following is the example which demonstrates how to indent the first line of a paragraph. Possible values are % or a number specifying indent space..

<p style="text-indent:1cm;">
This text will have first line indented by 1cm
and this line will remain at its actual position
this is done by CSS text-indent property.
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

This text will have first line indented by 1cm
and this line will remain at its actual position
this is done by CSS text-indent property.

 

 

ν…μŠ€νŠΈ μ •λ ¬ μ„€μ •

Following is the example which demonstrates how to align a text. Possible values are left, right, center, justify..

<p style="text-align:right;">
This will be right aligned.
</p>
<p style="text-align:center;">
This will be center aligned.
</p>
<p style="text-align:left;">
This will be left aligned.
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

This will be right aligned.

This will be center aligned.

This will be left aligned.

 

 

ν…μŠ€νŠΈ 꾸밈 μ„€μ •

Following is the example which demonstrates how to decorate a text. Possible values are none, underline, overline, line-through, blink..

<p style="text-decoration:underline;">
This will be underlined
</p>
<p style="text-decoration:line-through;">
This will be striked through.
</p>
<p style="text-decoration:overline;">
This will have a over line.
</p>
<p style="text-decoration:blink;">
This text will have blinking effect
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

This will be underlined

This will be striked through.

This will have a over line.

This text will have blinking effect

 

 

ν…μŠ€νŠΈ λŒ€μ†Œλ¬Έμž μ„€μ •

Following is the example which demonstrates how to set the cases for a text. Possible values are none, capitalize, uppercase, lowercase..

<p style="text-transform:capitalize;">
This will be capitalized
</p>
<p style="text-transform:uppercase;">
This will be in uppercase
</p>
<p style="text-transform:lowercase;">
This will be in lowercase
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

This will be capitalized

This will be in uppercase

This will be in lowercase

 

 

ν…μŠ€νŠΈ white-space μ„€μ •

Following is the example which demonstrates how white space inside an element is handled. Possible values are normal, pre, nowrap.

<p style="white-space:pre;">This text has a line break
and the white-space pre setting tells the browser to honor it
just like the HTML pre tag.</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€. 

This text has a line break and the white-space pre setting tells the browser to honor it just like the HTML pre tag.

 

 

ν…μŠ€νŠΈ 그림자 μ„€μ •

Following is the example which demonstrates how to set the shadow around a text. This may not be supported by all the browsers.

<p style="text-shadow:4px 4px 8px blue;">
If your browser supports the CSS text-shadow property, 
this text will have a  blue shadow.</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

If your browser supports the CSS text-shadow property, this text will have a blue shadow.

 

 

 

 

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

 

 

 

 

πŸ’» Programming/CSS

[CSS] 7. Fonts ( 폰트 μ„€μ • )

이번 ν¬μŠ€νŒ…μ—μ„œλŠ” CSSλ₯Ό μ΄μš©ν•΄μ„œ 폰트λ₯Ό μ„€μ •ν•˜λŠ” 방법에 λŒ€ν•΄μ„œ μ•Œμ•„λ³΄λ„λ‘ ν•˜κ² μŠ΅λ‹ˆλ‹€.

  • font-family λŠ” 폰트λ₯Ό λ³€κ²½ν•˜λŠ” μ†μ„±μž…λ‹ˆλ‹€. ( 돋움체, ꡴림체 뭐 μ΄λŸ°κ²ƒλ“€ 있죠? ) 

  • font-style λŠ” 폰트λ₯Ό 체λ₯Ό λ³€κ²½ν•˜λŠ” μ†μ„±μž…λ‹ˆλ‹€. ( italic, oblique ) 

  • font-variant λŠ” λŒ€μ†Œλ¬Έμžλ₯Ό μ„€μ •ν•˜λŠ” μ†μ„±μž…λ‹ˆλ‹€.

  • font-weight λŠ” 폰트의 κ΅΅κΈ°λ₯Ό μ„€μ •ν•˜λŠ” μ†μ„±μž…λ‹ˆλ‹€. ( bold, light ) 

  • font-size λŠ” 폰트 μ‚¬μ΄μ¦ˆλ₯Ό μ„€μ •ν•˜λŠ” μ†μ„±μž…λ‹ˆλ‹€.

  • font λŠ” ν°νŠΈκ΄€λ ¨ λͺ¨λ“  속성을 ν•œλ²ˆμ— μ„€μ •ν•  수 μžˆλŠ” ν•œλ°© μ†μ„±μž…λ‹ˆλ‹€.

 

폰트 νŒ¨λ°€λ¦¬ μ„€μ •ν•˜κΈ°

μ„€μ • κ°€λŠ₯ν•œ 값은 λͺ¨λ“  폰트 νŒ¨λ°€λ¦¬ κ°’μž…λ‹ˆλ‹€. 예λ₯Όλ“€λ©΄ aria, serif와 같은 폰트 μ„œμ²΄μž…λ‹ˆλ‹€.  

<p style="font-family:georgia,garamond,serif;">
This text is rendered in either georgia, garamond, or the default
serif font depending on which font  you have at your system.
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

This text is rendered in either georgia, garamond, or the default
serif font depending on which font you have at your system.

 

 

폰트 μŠ€νƒ€μΌ μ„€μ •ν•˜κΈ°

μ„€μ • κ°€λŠ₯ν•œ 값은 normal, italic 그리고 oblique μž…λ‹ˆλ‹€. 

<p style="font-style:italic;">
This text will be rendered in italic style
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

This text will be rendered in italic style

 

 

폰트 λ³€μ’… μ„€μ •ν•˜κΈ°

κ°€λŠ₯ν•œ 값은 normal κ³Ό small-capsκ°€ μžˆμŠ΅λ‹ˆλ‹€.

<p style="font-variant:small-caps;">
This text will be rendered as small caps
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

This text will be renedered as small caps

 

 

폰트 λ‘κ»˜ μ„€μ •ν•˜κΈ°

폰트의 λ‘κ»˜λ₯Ό μ„€μ •ν•˜λŠ” μ†μ„±μž…λ‹ˆλ‹€.

κ°€λŠ₯ν•œ 값은 normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900 이 μžˆμŠ΅λ‹ˆλ‹€.

<p style="font-weight:bold;">
This font is bold.
</p>
<p style="font-weight:bolder;">
This font is bolder.
</p>
<p style="font-weight:900;">
This font is 900 weight.
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

This font is bold.

This font is bolder.

This font is 900 weight.

 

 

폰트 μ‚¬μ΄μ¦ˆ μ„€μ •ν•˜κΈ°

κ°€λŠ₯ν•œ 값은 xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger, 그리고 ν”½μ…€κ°’ λ˜λŠ” νΌμ„ΌνŠΈ κ°’μž…λ‹ˆλ‹€.

<p style="font-size:20px;">
This font size is 20 pixels
</p>
<p style="font-size:10pt;">
This font size is small
</p>
<p style="font-size:14pt;">
This font size is large
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€. 

This font size is 20 pixels

This font size is small

This font size is large

 

 

폰트 μ‚¬μ΄μ¦ˆ adjust μ„€μ •ν•˜κΈ°

μ΄λ²ˆμ—λŠ” 폰트의 μ‚¬μ΄μ¦ˆ adjust 섀정을 ν•˜λŠ” κ²ƒμ΄λ„€μš”. κ°€λŠ₯ν•œ 값은 λͺ¨λ“  μˆ«μžκ°’μž…λ‹ˆλ‹€.  

<p style="font-size-adjust:0.61;">
This text is using a font-size-adjust value.
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

This text is using a font-size-adjust value.

 

 

폰트 슀트레치 μ„€μ •

κ°€λŠ₯ν•œ 값은 normal, wider, narrower, ultra-condensed, extra-condensed, condensed, semi-condensed, semi-expanded, expanded, extra-expanded, ultra-expanded κ°€ μžˆμŠ΅λ‹ˆλ‹€. 이 속성은 μ—¬λŸ¬λΆ„ 컴퓨터에 μžˆλŠ” ν°νŠΈκ°€ 

<p style="font-stretch:ultra-expanded;">
If this doesn't appear to work, it is likely that 
your computer doesn't have a condensed or expanded 
version of the font being used.
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

If this doesn't appear to work, it is likely that your computer doesn't have a condensed or expanded version of the font being used.

 

 

폰트 속성 ν•œλ²ˆμ— μ„€μ •ν•˜κΈ°

<p style="font:italic small-caps bold 15px georgia;">
Applying all the properties on the text at once.
</p>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€

Applying all the properties on the text at once.

 

 

 

 

μ΄μƒμœΌλ‘œ 폰트 κ΄€λ ¨ 속성듀에 λŒ€ν•΄μ„œ μ•Œμ•„λ³΄μ•˜μŠ΅λ‹ˆλ‹€.

 

휴우~~~ 슬슬 CSSκ°€ μž¬λ―Έμžˆμ–΄ μ§€μ‹œλ‚˜μš”? μ§€κ²¨μ›Œμ§€μ‹œλ‚˜μš”?

 

이제 μ‹œμž‘μΈλ° 말이죠 γ…‹γ…‹γ…‹

 

ν™”μ΄νŒ…μž…λ‹ˆλ‹€~~ 

 

 

 

 

 

 

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

 

 

 

 

 

πŸ’» Programming/CSS

[CSS] 6. Background ( λ°°κ²½ μ„€μ • )

이번 ν¬μŠ€νŒ…μ—μ„œλŠ” 각쒅 HTML νƒœκ·Έλ‚΄μ—μ„œ μ“°μ΄λŠ” λ°°κ²½ κ΄€λ ¨ 속성에 λŒ€ν•΄μ„œ μ•Œμ•„λ³΄λ„λ‘ ν•˜κ² μŠ΅λ‹ˆλ‹€. λ°°κ²½κ΄€λ ¨ μ†μ„±μ—λŠ” λ‹€μŒκ³Ό 같은 것듀이 μžˆμŠ΅λ‹ˆλ‹€.

  •  background-color λŠ” λ°°κ²½ 색상을 μ„€μ •ν•˜κΈ° μœ„ν•œ μ†μ„±μž…λ‹ˆλ‹€.

  •  background-image λŠ” λ°°κ²½ 이미지λ₯Ό μ„€μ •ν•˜κΈ° μœ„ν•œ μ†μ„±μž…λ‹ˆλ‹€.

  •  background-repeat λŠ” λ°°κ²½ μ΄λ―Έμ§€μ˜ 반볡 μ—¬λΆ€λ₯Ό μ„€μ •ν•˜κΈ° μœ„ν•œ μ†μ„±μž…λ‹ˆλ‹€.

  •  background-position λŠ” λ°°κ²½ μ΄λ―Έμ§€μ˜ μœ„μΉ˜λ₯Ό μ„€μ •ν•˜κΈ° μœ„ν•œ μ†μ„±μž…λ‹ˆλ‹€.

  •  background-attachment λŠ” λ°°κ²½ μ΄λ―Έμ§€μ˜ μŠ€ν¬λ‘€λ§μ„ μ„€μ •ν•˜κΈ° μœ„ν•œ μ†μ„±μž…λ‹ˆλ‹€.

  •  background property is used as shorthand to specify a number of other background properties.

 

λ°°κ²½ 색 μ„€μ •ν•˜κΈ°

<p style="background-color:yellow;">
This text has a yellow background color.
</p>

This will produce following result:

This text has a yellow background color.

 

 

 

λ°°κ²½ 이미지 μ„€μ •ν•˜κΈ°

<table style="background-image:url(/images/pattern1.gif);">
<tr><td>
This table has background image set.
</td></tr>
</table>

 

 

λ°°κ²½ 이미지 λ°˜λ³΅ν•˜κΈ°

<table style="background-image:url(/images/pattern1.gif); 
              background-repeat: repeat;">
<tr><td>
This table has background image which repeats multiple times.
</td></tr>
</table>

 

μ•„λž˜ μ˜ˆμ œλŠ” λ°°κ²½ 이미지λ₯Ό μ„Έλ‘œλ‘œ λ°˜λ³΅μ‹œν‚€λŠ” μ˜ˆμ œμž…λ‹ˆλ‹€.

<table style="background-image:url(/images/pattern1.gif); 
              background-repeat: repeat-y;">
<tr><td>
This table has background image set which will repeat vertically.
</td></tr>
</table>

 

μ•„λž˜λŠ” λ°°κ²½ 이미지λ₯Ό κ°€λ‘œλ‘œ λ°˜λ³΅μ‹œν‚€λŠ” μ˜ˆμ œμž…λ‹ˆλ‹€.

<table style="background-image:url(/images/pattern1.gif); 
              background-repeat: repeat-x;">
<tr><td>
This table has background image set which will repeat horizontally.
</td></tr>
</table>

 

 

λ°°κ²½ 이미지 μœ„μΉ˜ μ„€μ •ν•˜κΈ°

λ°°κ²½ 이미지λ₯Ό μ™Όμͺ½μ—μ„œ 100 ν”½μ…€ λ–¨μ–΄λœ¨λ €μ„œ μœ„μΉ˜μ‹œν‚€λŠ” μ˜ˆμ œμž…λ‹ˆλ‹€. 

<table style="background-image:url(/images/pattern1.gif); 
              background-position:100px;">
<tr><td>
Background image positioned 100 pixels away from the left.
</td></tr>
</table>

λ‹€μœΌλ―€ μ˜ˆμ œλŠ” λ°°κ²½ μ΄λ―Έμ§€μ˜ μœ„μΉ˜λ₯Ό μ™Όμͺ½μ—μ„œ 100 ν”½μ…€ 그리고 μœ„μ—μ„œ 200 ν”½μ…€ 떨어진 곳에 μœ„μΉ˜μ‹œν‚€λŠ” μ˜ˆμ œμž…λ‹ˆλ‹€.

<table style="background-image:url(/images/pattern1.gif); 
              background-position:100px 200px;">
<tr><td>
This table has background image positioned 100
pixels away from the left and 200 pixels from the top.
</td></tr>
</table>

 

 

λ°°κ²½ 이미지 κ³ μ • λ˜λŠ” 슀크둀 μ—¬λΆ€ μ„€μ •ν•˜κΈ°

Background attachment determines whether a background image is fixed or scrolls with the rest of the page.

 

μ•„λž˜ μ˜ˆμ œλŠ” 배경이미지λ₯Ό κ³ μ •μ‹œν‚€λŠ” μ˜ˆμ œμž…λ‹ˆλ‹€. 

<p style="background-image:url(/images/pattern1.gif); 
              background-attachment:fixed;">
This parapgraph has fixed background image.
</p>

이번 μ˜ˆμ œλŠ” μŠ€ν¬λ‘€λ§μ„ ν•΄μ£ΌλŠ” μ˜ˆμ œλ„€μš”.

<p style="background-image:url(/images/pattern1.gif); 
              background-attachment:scroll;">
This parapgraph has scrolling background image.
</p>

 

 

λ°°κ²½ 속성 ν•œκΊΌλ²ˆμ— μ„€μ •ν•˜κΈ°

background 속성은 μ—¬λŸ¬κ°œμ˜ λ°°κ²½κ΄€λ ¨ 속성을 ν•œκΊΌλ²ˆμ— μ„€μ •ν•  수 μžˆλ„λ‘ ν•΄μ€λ‹ˆλ‹€. 

<p style="background:url(/images/pattern1.gif) repeat fixed;">
This parapgraph has fixed repeated background image.
</p>

 

 

 

 

 

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

 

 

 

 

 

 

 

 

πŸ’» Programming/CSS

[CSS] 5. Colors ( 색깔 )

 

CSS μ—μ„œ 색깔을 μ§€μ •ν•˜λŠ” 방법은 μ•„λž˜μ²˜λŸΌ 5가지 방법이 μžˆμŠ΅λ‹ˆλ‹€

FormatSyntaxExample
Hex Code#RRGGBBp{color:#FF0000;}
Short Hex Code#RGBp{color:#6A7;}
RGB %rgb(rrr%,ggg%,bbb%)p{color:rgb(50%,50%,50%);}
RGB Absolutergb(rrr,ggg,bbb)p{color:rgb(0,0,255);}
keywordaqua, black, etc.p{color:teal;}

 

μ•„λž˜μ—μ„œ μ’€ 더 μžμ„Ένžˆ μ•Œμ•„λ³΄λ„λ‘ ν•˜μ£ . 


1. CSS Colors - Hex Codes ( 16μ§„μˆ˜ RRGGBB μ½”λ“œ )

16μ§„μˆ˜ μ½”λ“œλ‘œ ν‘œν˜„ν•  λ•ŒλŠ” # 기호λ₯Ό λ¨Όμ € λΆ™μ—¬μ£Όκ³  6자리의 RRGGBB μ½”λ“œλ₯Ό λ„£μ–΄μ£Όλ©΄ λ©λ‹ˆλ‹€. RGB의 R은 λΉ¨κ°•, GλŠ” 초둝, BλŠ” νŒŒλž‘μž…λ‹ˆλ‹€. RRμ΄λΌλŠ” 것은 빨강을 λ‚˜νƒ€λ‚΄λŠ” 16μ§„μˆ˜ 숫자λ₯Ό λ§ν•©λ‹ˆλ‹€. 예λ₯Ό λ“€λ©΄ 00λΆ€ν„° FFκΉŒμ§€μ˜ 값이 λ©λ‹ˆλ‹€. GG와 BBμ—­μ‹œ λ§ˆμ°¬κ°€μ§€μž…λ‹ˆλ‹€.

μ•„λž˜λŠ” μ΄λ ‡κ²Œ 16μ§„μˆ˜λ₯Ό μ΄μš©ν•΄μ„œ 색깔을 ν‘œμ‹œν–ˆμ„ λ•Œ μ–΄λ–»κ²Œ 화면에 λ³΄μ—¬μ§€λŠ”μ§€λ₯Ό λ³΄μ—¬μ£ΌλŠ” ν‘œμž…λ‹ˆλ‹€.


ColorColor HEX
 #000000
 #FF0000
 #00FF00
 #0000FF
 #FFFF00
 #00FFFF
 #FF00FF
 #C0C0C0
 #FFFFFF

 

 

CSS Colors - Short Hex Codes ( 16μ§„μˆ˜ RGB μ½”λ“œ )

μ΄λ²ˆμ—λŠ” μ’€ 짧게 μ“°λŠ” RGBμ½”λ“œμž…λ‹ˆλ‹€. μœ„μ—μ„œ RRGGBB둜 μ“°μ˜€λ˜ 것이 RGB둜 쀄어든 것이죠. λ‹€λ₯Έ 점은 μœ„ μ—¬μ„―μžλ¦¬ RRGGBBμ½”λ“œμ—μ„œλŠ” μ’€ 더 μ„Έλ°€ν•˜κ²Œ 색깔을 지정할 수 μžˆλŠ” 반면 RGBμ½”λ“œμ—μ„œλŠ” μ’€ λ‹¨μˆœν™”λœ μƒ‰κΉ”λ§Œ μ‚¬μš©ν•  수 μžˆλ‹€λŠ” 것이죠. κ·Έ μ΄μœ μΈμ¦‰μŠ¨ RR λ‘κ°œλ‘œ ν‘œμ‹œν•  수 μ΄μ—ˆλ˜ 빨간계열 색상을 Rν•˜λ‚˜λ‘œλ§Œ λ‚˜νƒ€λ‚΄μ•Όν•˜κΈ° λ•Œλ¬Έμž…λ‹ˆλ‹€. 예λ₯Όλ“€μ–΄ RGBμ½”λ“œμ˜ #FFFμ—μ„œ R을 λ‚˜νƒ€λ‚΄λŠ” FλŠ” RRGGBB의 RR둜 λ³€ν™˜ν•œλ‹€λ©΄ FFκ°€ 되겠죠. λ§Œμ•½ RRGGBB의 RR값에 ADκ°€ λ“€μ–΄μžˆμ—ˆλ‹€κ³  ν•˜λ©΄ 이것을 RGB둜 ν‘œν˜„ν•  수 μžˆμ„ κΉŒμš”? μ•„λ‹™λ‹ˆλ‹€. ν‘œν˜„ν•  수 μ—†κ² μ£ .
ColorColor HEX
 #000
 #F00
 #0F0
 #0FF
 #FF0
 #0FF
 #F0F
 #FFF

 

 

CSS Colors - RGB Values ( 10μ§„μˆ˜ RGB μ½”λ“œ )

이 방법은 rgb( ) 속성을 μ΄μš©ν•©λ‹ˆλ‹€.  0 λΆ€ν„° 255 μˆ«μžλ‚˜ νΌμ„ΌνŠΈλ₯Ό 값에 넣어쀄 수 μžˆμŠ΅λ‹ˆλ‹€.

NOTE: λͺ¨λ“  λΈŒλΌμš°μ €κ°€ rgb() 속성을 μ§€μ›ν•˜λŠ” 것이 μ•„λ‹ˆκΈ° λ•Œλ¬Έμ— 이 방법은 ꢌμž₯ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. 

 

ColorColor RGB
 rgb(0,0,0)
 rgb(255,0,0)
 rgb(0,255,0)
 rgb(0,0,255)
 rgb(255,255,0)
 rgb(0,255,255)
 rgb(255,0,255)
 rgb(192,192,192)
 rgb(255,255,255)

 

예제 :  

<body style="color:rgb(0,0,255); background-color:rgb(0,255,0);"> 

Building Color Codes:

색깔 μ½”λ“œλ₯Ό λ§Œλ“€μ–΄μ£ΌλŠ” 칼라 μ½”λ“œ λΉŒλ”λΌλŠ”κ²Œ μžˆλ„€μš”.  HTML Color Code Builder.  

Browser Safe Colors:

μ•„λž˜ ν‘œλŠ” λΈŒλΌμš°μ €μ˜ 영ν–₯μ΄λ‚˜ 컴퓨터 λ””μŠ€ν”Œλ ˆμ΄μ˜ 영ν–₯을 κ°€μž₯ μ•ˆλ°›λŠ” 그런 μΉΌλΌν‘œλΌκ³  ν•˜λ„€μš”. 총 216 개의 색깔이 μžˆμŠ΅λ‹ˆλ‹€.

색깔을 보고 λ§˜μ—λ“œλŠ”κ±° μ½”λ“œ 골라닀가 μ“°μ‹œλ©΄ λ©λ‹ˆλ‹Ή. ^____^

 

0000000000330000660000990000CC0000FF
0033000033330033660033990033CC0033FF
0066000066330066660066990066CC0066FF
0099000099330099660099990099CC0099FF
00CC0000CC3300CC6600CC9900CCCC00CCFF
00FF0000FF3300FF6600FF9900FFCC00FFFF
3300003300333300663300993300CC3300FF
3333003333333333663333993333CC3333FF
3366003366333366663366993366CC3366FF
3399003399333399663399993399CC3399FF
33CC0033CC3333CC6633CC9933CCCC33CCFF
33FF0033FF3333FF6633FF9933FFCC33FFFF
6600006600336600666600996600CC6600FF
6633006633336633666633996633CC6633FF
6666006666336666666666996666CC6666FF
6699006699336699666699996699CC6699FF
66CC0066CC3366CC6666CC9966CCCC66CCFF
66FF0066FF3366FF6666FF9966FFCC66FFFF
9900009900339900669900999900CC9900FF
9933009933339933669933999933CC9933FF
9966009966339966669966999966CC9966FF
9999009999339999669999999999CC9999FF
99CC0099CC3399CC6699CC9999CCCC99CCFF
99FF0099FF3399FF6699FF9999FFCC99FFFF
CC0000CC0033CC0066CC0099CC00CCCC00FF
CC3300CC3333CC3366CC3399CC33CCCC33FF
CC6600CC6633CC6666CC6699CC66CCCC66FF
CC9900CC9933CC9966CC9999CC99CCCC99FF
CCCC00CCCC33CCCC66CCCC99CCCCCCCCCCFF
CCFF00CCFF33CCFF66CCFF99CCFFCCCCFFFF
FF0000FF0033FF0066FF0099FF00CCFF00FF
FF3300FF3333FF3366FF3399FF33CCFF33FF
FF6600FF6633FF6666FF6699FF66CCFF66FF
FF9900FF9933FF9966FF9999FF99CCFF99FF
FFCC00FFCC33FFCC66FFCC99FFCCCCFFCCFF
FFFF00FFFF33FFFF66FFFF99FFFFCCFFFFFF

 

 

 

 

 

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

 

 

 

 

πŸ’» Programming/CSS

[CSS] 4. Units ( λ‹¨μœ„ )

CSS μ—μ„œ μ‚¬μš©ν•˜λŠ” λ‹¨μœ„(Unit)

μ‹€μ œλ‘œ CSS둜 λ­”κ°€λ₯Ό ν•˜κΈ°μ „μ— κΈ°λ³ΈλΆ€ν„° 닀지고 κ°€λŠ”κ²Œ μ’‹κ² μ£ ?

κ·Έλž˜μ„œ μ΄λ²ˆμ—λŠ” 각쒅 속성값에 μ“°μ΄λŠ” λ‹¨μœ„λ₯Ό ν•œλ²ˆ μ•Œμ•„λ³΄λ„λ‘ ν•˜κ² μŠ΅λ‹ˆλ‹€.

 

CSSλŠ” μ ˆλŒ€κ°’μ„ λ‚˜νƒ€λ‚΄λŠ” inches, centimeters, points λ“±λ“± 뿐 μ•„λ‹ˆλΌ μƒλŒ€κ°’μ„ λ‚˜νƒ€λ‚΄λŠ” percentagesλ‚˜ em λ‹¨μœ„λ₯Ό μ§€μ›ν•©λ‹ˆλ‹€. 이런 λ‹¨μœ„λ“€μ€ 자주 쓰이기 λ•Œλ¬Έμ— κΌ­ 짚고 λ„˜μ–΄κ°€μ‹œλŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

 

λ‹€μŒμ€ λ‹¨μœ„μ™€ λ‹¨μœ„μ— λŒ€ν•œ μ„€λͺ… 및 μ‚¬μš© μ˜ˆμ œμž…λ‹ˆλ‹€. 

Unit Description Example
% νΌμ„ΌνŠΈ p {font-size: 16pt; line-height: 125%;}
cm μ„Όν‹°λ―Έν„° div {margin-bottom: 2cm;}
em em λ‹¨μœ„λŠ” 폰트의 μ‚¬μ΄μ¦ˆμ™€ λ™μΌν•˜κΈ° λ•Œλ¬Έμ— ν°νŠΈμ‚¬μ΄μ¦ˆλ₯Ό 12pt둜 μ„€μ •ν•˜λ©΄ 각 em λ‹¨μœ„λŠ” 12ptκ°€ λ©λ‹ˆλ‹€. λ”°λΌμ„œ 2em은 24ptκ°€ 되겠죠 p {letter-spacing: 7em;}
ex 이 값은 폰트의 x-높이값에 μƒλŒ€μ μΈ κ°’μž…λ‹ˆλ‹€. x-높이값은 ν•΄λ‹Ή 폰트의 μ†Œλ¬Έμžxκ°’μ˜ λ†’μ΄μž…λ‹ˆλ‹€. p {font-size: 24pt; line-height: 3ex;}
in 인치 p {word-spacing: .15in;}
mm 밀리미터 p {word-spacing: 15mm;}
pc picasλΌλŠ” λ‹¨μœ„λ‘œ 1 picaλŠ” 12 pt와 λ™μΌν•©λ‹ˆλ‹€; λ”°λΌμ„œ, 1μΈμΉ˜μ—λŠ” 6 picas κ°€ μ‘΄μž¬ν•©λ‹ˆλ‹€. p {font-size: 20pc;}
pt 포인트 λ‹¨μœ„λ‘œ 1 ptλŠ” 72λΆ„μ˜ 1 μΈμΉ˜μž…λ‹ˆλ‹€. body {font-size: 18pt;}
px 슀크린 ν”½μ…€ λ‹¨μœ„ p {padding: 25px;}

 

example에 μžˆλŠ” λ‚΄μš©μ„ css νŒŒμΌμ— μž‘μ„±ν•΄μ„œ κΌ­!! ν…ŒμŠ€νŠΈν•΄λ³΄μ„Έμš”~

 

 

 

 

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

 

 

CSSλ₯Ό HTMLλ¬Έμ„œμ—μ„œ μ‚¬μš©ν•˜λŠ” 방법은 넀가지가 μžˆμŠ΅λ‹ˆλ‹€. κ·Έ μ€‘μ—μ„œλ„ κ°€μž₯ 많이 μ“°μ΄λŠ” 방법은 inline CSS와 External CSS.

1. Embedded CSS - The <style> Element:

 <style> μš”μ†Œλ₯Ό μ΄μš©ν•΄μ„œ <head>...</head> νƒœκ·Έ 내에 μ‚½μž…ν•˜λŠ” λ°©λ²•μž…λ‹ˆλ‹€. 

<head>
<style type="text/css" media="...">
Style Rules
............
</style>
</head>

속성:

 <style> νƒœκ·Έ λ‚΄μ˜ 속성과 값은 μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

Attribute Value Description
type text/css Specifies the style sheet language as a content-type (MIME type). This is required attribute.
media screen
tty
tv
projection
handheld
print
braille
aural
all
Specifies the device the document will be displayed on. Default value is all. This is optional attribute.

예제:

<head>
<style type="text/css" media="all">
h1{
color: #36C;
}
</style>
</head>

2. Inline CSS - The style Attribute:

인라인 CSSλŠ” κ·Έλƒ₯ htmlνƒœκ·Έ μ•ˆμ—λ‹€κ°€ μ¨λ„£λŠ” 것을 λ§ν•©λ‹ˆλ‹€. κ°€μž₯ 일반적으둜 μ΄λ ‡κ²Œ μ‚¬μš©ν•˜μ£ . κ·ΈλŸ¬λ‹€κ°€ λ”°λ‘œ λΆ„λ¦¬ν•΄μ„œ κ΄€λ¦¬ν•΄μ•Όλ˜λŠ” μŠ€νƒ€μΌμ΄ μžˆλ‹€λ©΄ 이 λ‹€μŒμ— μ„€λͺ…ν•œ External CSSλ₯Ό μ΄μš©ν•˜μ‹œλ©΄ λ©λ‹ˆλ‹€. 

<element style="...style rules....">

속성:

Attribute Value Description
style style rules The value of style attribute is a combination of style declarations separated by semicolon (;).

예제:

<h1 style ="color:#36C;"> This is inline CSS </h1>

 

적용된 κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€. 

This is inline CSS

3. External CSS - The <link> Element:

 <link> μš”μ†Œλ₯Ό μ΄μš©ν•˜μ—¬ HTML λ¬Έμ„œμ— μ™ΈλΆ€μ—μ„œ μ •μ˜λœ CSSνŒŒμΌμ„ λ§ν¬μ‹œν‚¬ μˆ˜κ°€ μžˆμŠ΅λ‹ˆλ‹€. 

κ°„λ‹¨ν•œ 문법을 ν•œλ²ˆ λ³ΌκΉŒμš”??

<head>
<link type="text/css" href="..." media="..." />
</head>

속성:

 <link> νƒœκ·Έμ˜ 속성과 속성값듀 μž…λ‹ˆλ‹€. 

Attribute Value Description
type text/css Specifies the style sheet language as a content-type (MIME type). This attribute is required.
href URL Specifies the style sheet file having Style rules. This attribute is a required.
media screen
tty
tv
projection
handheld
print
braille
aural
all
Specifies the device the document will be displayed on. Default value is all. This is optional attribute.

예제:

κ°„λ‹¨ν•˜κ²Œ mystyle.css λ₯Ό λ§Œλ“€μ–΄ λ΄…μ‹œλ‹€.

h1, h2, h3 {
color: #36C;
font-weight: normal;
letter-spacing: .4em;
margin-bottom: 1em;
text-transform: lowercase;
}

 

이제 mystyle.cssνŒŒμΌμ„ HTMLλ¬Έμ„œμ— 링크λ₯Ό μ‹œμΌœλ³ΌκΉŒμš”??

<head>
<link type="text/css" href="mystyle.css" media="all" />
</head>

4. Imported CSS - @import Rule:

@import λ₯Ό μ΄μš©ν•΄μ„œ <link> μš”μ†Œμ²˜λŸΌ μŠ€νƒ€μΌνŒŒμΌμ— 링크λ₯Ό κ±Έ μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.  기본문법은 λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.

<head>
@import "URL";
</head>

 

μ•„λž˜μ²˜λŸΌ url()λ©”μ†Œλ“œλ₯Ό μ΄μš©ν•  μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.

<head>
@import url("URL");
</head>

예제:

<head>
@import "mystyle.css";
</head>

CSS Rules Overriding ( κ·œμΉ™ μ˜€λ²„λΌμ΄λ”© )

μ§€κΈˆκΉŒμ§€ CSSλ₯Ό μ‚¬μš©ν•˜λŠ” 넀가지 방법에 λŒ€ν•΄μ„œ μ•Œμ•„λ³΄μ•˜μŠ΅λ‹ˆλ‹€. 이 넀가지 κ·œμΉ™μ΄ λ™μ‹œμ— 적용이 λœλ‹€λ©΄ 어떀일이 λ²Œμ–΄μ§ˆκΉŒμš”??? μ„œλ‘œμ„œλ‘œ μ˜€λ²„λΌμ΄λ”©μ„ ν•˜κ²Œ λ˜λŠ”λ° κ·Έ κ·œμΉ™μ„ ν•œλ²ˆ μ•Œμ•„λ³΄λ„λ‘ ν•˜κ² μŠ΅λ‹ˆλ‹€. 

  • inline μŠ€νƒ€μΌμ΄ λ‹€λ₯Έ 방법보닀 항상 μ΅œμš°μ„ μ‹œ μ μš©λ©λ‹ˆλ‹€.  

  • <style>...</style> νƒœκ·Έ 내에 μ§€μ •λœ μŠ€νƒ€μΌλ“€μ€ μ™ΈλΆ€ CSSνŒŒμΌμ— μ •μ˜λœ 값듀보닀 μš°μ„ κΆŒμ„ κ°€μ§‘λ‹ˆλ‹€.

  • μ™ΈλΆ€ CSSνŒŒμΌμ€ 항상 μ΅œμ €μš°μ„ κΆŒμ„ κ°€μ§‘λ‹ˆλ‹€. 

Handling old Browsers ( ꡬ버전 λΈŒλΌμš°μ € 처리 )

ꡬ버전 λΈŒλΌμš°μ € μ€‘μ—λŠ” CSSλ₯Ό μ§€μ›ν•˜μ§€ μ•ŠλŠ” λΈŒλΌμš°μ €κ°€ 있고 이런 λΈŒλΌμš°μ €λ₯Ό μ‚¬μš©ν•˜λŠ” μ‚¬μš©μžλ“€μ΄ μžˆμ„ μˆ˜λ„ 있겠죠. λ§Œμ•½ κ·ΈλŸ΄κ²½μš°μ—λŠ” CSSλ₯Ό μ μš©ν•˜μ§€ μ•Šλ„λ‘ ν•  수 μžˆμŠ΅λ‹ˆλ‹€. μ•„λž˜μ²˜λŸΌ <!-- 와  --> 둜 κ°μ‹Έμ„œ 말이죠. 

<style type="text/css">
<!--
body, td {
   color: blue;
}
-->
</style>

CSS Comments ( 주석 )

CSSμ—μ„œ 주석은 /* μ£Όμ„μ²˜λ¦¬ ν•  λ‚΄μš© */  μ΄λ ‡κ²Œ μ“°μ‹œλ©΄ λ©λ‹ˆλ‹€. μ—¬λŸ¬ 쀄에 걸쳐도 관계 μ—†μŠ΅λ‹ˆλ‹€. 

예제:

/* This is an external style sheet file */
h1, h2, h3 {
color: #36C;
font-weight: normal;
letter-spacing: .4em;
margin-bottom: 1em;
text-transform: lowercase;
}
/* end of 
style rules. */

 

 

 

 

 

 

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

 

 

 

 

 

 

'πŸ’» Programming > CSS' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€

[CSS] 6. Background ( λ°°κ²½ μ„€μ • )  (0) 2016.06.12
[CSS] 5. Colors ( 색깔 )  (0) 2016.06.12
[CSS] 4. Units ( λ‹¨μœ„ )  (0) 2016.06.12
[CSS] 2. Syntax ( 문법, μ‚¬μš©λ²• )  (0) 2016.06.12
[CSS] 1. CSSλž€ ?  (0) 2016.06.11

πŸ’» Programming/CSS

[CSS] 2. Syntax ( 문법, μ‚¬μš©λ²• )

 

CSS λ₯Ό μ‚¬μš©ν•˜λ €λ©΄ 문법에 따라야겠죠?? 이번 ν¬μŠ€νŒ…μ—μ„œλŠ” κ·Έ 문법에 λŒ€ν•΄μ„œ μ•Œμ•„λ³΄λ„λ‘ ν•˜κ² μŠ΅λ‹ˆλ‹€.  

CSSλŠ” μŠ€νƒ€μΌ κ·œμΉ™μ„ λ”°λ₯΄λŠ”데 이 μŠ€νƒ€μΌ κ·œμΉ™μ—λŠ” 세가지 μš”μ†Œκ°€ μžˆμŠ΅λ‹ˆλ‹€. 

  • μ…€λ ‰ν„° : μ…€λ ‰ν„°λŠ” HTML νƒœκ·Έμ˜ 이름을 λ§ν•©λ‹ˆλ‹€. 예λ₯Όλ“€λ©΄ <h1> νƒœκ·Έμ˜ h1μ΄λ‚˜ <table> νƒœκ·Έμ˜ table이 셀렉터인거죠.

  • 속성 : 속성은 htmlνƒœκ·Έ λ‚΄μ—μ„œ μ‚¬μš©λ˜λŠ” 그런 속성듀을 λ§ν•©λ‹ˆλ‹€. colorλ‚˜ border같은 것듀을 λ§ν•˜λŠ”κ±°μ£ .

  • κ°’ : 이 값은 속성에 ν• λ‹Ήλ˜λŠ” 값을 λ§ν•©λ‹ˆλ‹€. color속성이 red값을 κ°–λŠ”λ‹€ 뭐 이런거죠.

이 세가지 μš”μ†Œλ₯Ό ν•©ν•˜λ©΄ κ·Έκ²Œλ°”λ‘œ μ•„λž˜μ™€ 같은 μŠ€νƒ€μΌ κ·œμΉ™μž…λ‹ˆλ‹€.

μ…€λ ‰ν„° { 속성 : κ°’ }

예제 : ν…Œμ΄λΈ” μ…€λ ‰ν„°μ˜ 속성 μ§€μ •ν•˜κΈ°

table{ border :1px solid #C00; }

μœ„ μ˜ˆμ œκ°€ λ­ν•˜λŠ”κ±΄μ§€ 이해가 λ˜λ‚˜μš”? tableνƒœκ·Έμ˜ 속성 쀑에 border 속성 값을 1px solid #C00 둜 섀정을 ν•œκ²λ‹ˆλ‹€.

 

자, 이제 μ–΄λŠμ •λ„ 감이 μ˜€λ‚˜μš”???  

 

그럼 이제 셀렉터듀이 μ–΄λ–€ 것듀이 μžˆλŠ”μ§€λ„ ν•œλ²ˆ λ΄λ³ΌκΉŒμš”? 

The Type Selectors ( νƒ€μž… μ…€λ ‰ν„° )

h1νƒœκ·Έκ°€ λ­”μ§€λŠ” 이미 μ•„μ‹œκ² μ£ ? 레벨1 헀더 νƒœκ·Έμ£ . κ·Έ νƒœκ·Έμ˜ 색깔 속성을 μ§€μ •ν•΄μ£ΌλŠ” μ˜ˆμ œκ°€ 밑에 μžˆκ΅°μš”.

h1 { 
   color: #36CFFF; 
}

The Universal Selectors ( μœ λ‹ˆλ²„μ„€ μ…€λ ‰ν„° )

ν•˜λ‚˜μ˜ νŠΉμ •ν•œ μ…€λ ‰ν„°λ₯Ό μ„ νƒν•˜λŠ” 것이 μ•„λ‹ˆλΌ λͺ¨λ“  셀렉터에 λŒ€ν•΄μ„œ 속성을 지정해주고 μ‹Άμ„λ•Œ μ‚¬μš©ν•˜λŠ” μœ λ‹ˆλ²„μ„€ μ…€λ ‰ν„°μž…λ‹ˆλ‹€. * κΈ°ν˜ΈλŠ” "λͺ¨λ“ "μ΄λΌλŠ” 의미λ₯Ό κ°–κ³ μžˆμ£ .

* { 
  color: #000000; 
}

λͺ¨λ“  μ…€λ ‰ν„°(νƒœκ·Έ)에 λŒ€ν•΄μ„œ μƒ‰κΉŒ 속성값을 κ²€μ •μœΌλ‘œ μ„€μ •ν•œ 예제죠? μ•„λ‹Œκ°€μš”? 

The Descendant Selectors ( 후손 μ…€λ ‰ν„° )

νƒœκ·Έμ•ˆμ— 또 λ‹€λ₯Έ νƒœκ·Έκ°€ λ“€μ–΄κ°ˆ μˆ˜κ°€ μžˆμŠ΅λ‹ˆλ‹€. κ·ΈλŸ΄λ•Œ 후손 셀렉터에 λŒ€ν•΄μ„œλ§Œ μ μš©μ„ ν•˜κ³  싢은 속성값이 μžˆμ„ν…λ° κ·ΈλŸ΄λ•ŒλŠ” μ•„λž˜μ™€ 같이 μ‚¬μš©ν•˜μ‹œλ©΄ λ©λ‹ˆλ‹€. μ•„λž˜ μ˜ˆμ œλŠ” ulνƒœκ·Έ μ•ˆμ— μ‚¬μš©λœ emνƒœκ·Έμ˜ 속성을 μ§€μ •ν•΄μ£ΌλŠ” μ˜ˆμ œμž…λ‹ˆλ‹€.

ul em {
  color: #000000; 
}

The Class Selectors ( 클래슀 μ…€λ ‰ν„° )

λ§Œμ•½ 클래슀 λ‹¨μœ„λ‘œ 속성값을 지정해주고 μ‹Άλ‹€λ©΄ 클래슀 μ…€λ ‰ν„°λ₯Ό μ‚¬μš©ν•˜μ‹œλ©΄ λ©λ‹ˆλ‹€.  

μ‚¬μš©λ²•μ€ μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€. 점(.)을 찍고 λΆ™μ—¬μ„œ 클래슀λͺ…을 μ¨μ£Όμ‹œλ©΄ λ©λ‹ˆλ‹€. 

.black {
  color: #000000; 
}

μœ„ μ˜ˆμ œλŠ” blackν΄λž˜μŠ€μ— μ†ν•œ λͺ¨λ“  νƒœκ·Έμ˜ 색을 검정색(#000000)으둜 μ§€μ •ν•΄μ£ΌλŠ” μ˜ˆμ œλ„€μš” . μ’€ 더 λ²”μœ„λ₯Ό μ’ν˜€μ„œ μ•„λž˜μ²˜λŸΌ μ‚¬μš©ν•˜μ‹€ μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.  

h1.black {
  color: #000000; 
}

 <h1> νƒœκ·Έμ΄λ©΄μ„œ blackν΄λž˜μŠ€μ— μ†ν•œ νƒœκ·Έλ“€μ˜ 색깔을 λͺ¨λ‘ #000000으둜 μ§€μ •ν•΄μ£ΌλŠ” μ˜ˆμ œκ΅°μš”.

 

# 참고둜 μ•„λž˜μ²˜λŸΌ ν•˜λ‚˜μ˜ νƒœκ·Έμ— μ—¬λŸ¬κ°œμ˜ 클래슀λ₯Ό λΆ€μ—¬ν•  수 μžˆλ‹€λŠ” 점도 μ•Œκ³ κ³„μ‹œλ©΄ μ’‹κ² λ„€μš”:

<p class="center bold">
This para will be styled by the classes center and bold.
</p>

The ID Selectors ( 아이디 μ…€λ ‰ν„° )

μ΄λ²ˆμ—λŠ” 아이디 셀렉터에 λŒ€ν•΄μ„œ 보도둝 ν•˜κ² μŠ΅λ‹ˆλ‹€. λͺ¨λ“  νƒœκ·Έμ—λŠ” 아이디λ₯Ό λΆ€μ—¬ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 그리고 κ·Έλ ‡κ²Œ λΆ€μ—¬λœ 아이디λ₯Ό μ…€λ ‰νŠΈν•˜κΈ°μœ„ν•΄μ„œλŠ” # 기호λ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€. 

#black {
  color: #000000; 
}

μœ„ μ˜ˆμ œλŠ” idκ°€ black인 μš”μ†Œμ˜ 색깔을 κ²€μ •μœΌλ‘œ μ§€μ •ν•˜λŠ” μ˜ˆμ œμž…λ‹ˆλ‹€.

h1#black {
  color: #000000; 
}

μœ„ μ˜ˆμ œλŠ” <h1> μš”μ†Œλ‚΄μ˜ λͺ¨λ“  μš”μ†Œλ“€ μ€‘μ—μ„œ idκ°€ black인 λ…€μ„μ—κ²Œλ§Œ 검정색 속성을 μ£Όμ—ˆλ„€μš”

이 idμ…€λ ‰ν„°κ°€ κ°€μž₯ μœ μš©ν•˜κ²Œ μ“°μ΄λŠ” κ²½μš°λŠ” μ•„λž˜μ²˜λŸΌ 후손 μ…€λ ‰ν„°λ“€μ—κ²Œ 속성을 λΆ€μ—¬ν•  λ•Œμž…λ‹ˆλ‹€.

#black h2 {
  color: #000000; 
}

μœ„ μ˜ˆμ œλŠ” νƒœκ·Έidκ°€ black인 νƒœκ·Έλ‚΄μ˜ h2νƒœκ·Έμ˜ 색깔 속성값을 μ§€μ •ν•΄μ£ΌλŠ” 예제죠? μ•„λ‹Œκ°€μš”? λ§žμŠ΅λ‹ˆλ‹€. 

The Child Selectors ( μžμ‹ μ…€λ ‰ν„° )

μœ„μ—μ„œ λ§ν•œ 후손 μ…€λ ‰ν„°λŠ” descendant λΌκ³ ν•˜μ—¬ λͺ¨λ“  후손듀에 λŒ€ν•΄ 적용이 λ©λ‹ˆλ‹€. ν•˜μ§€λ§Œ 이 μžμ‹ μ…€λ ‰ν„°λŠ” 직계 μžμ‹λ§Œ 해당이 λ©λ‹ˆλ‹€. 예제λ₯Ό ν•œλ²ˆ λ³΄μ‹€κΉŒμš”.

body > p {
  color: #000000; 
}

<body> νƒœκ·Έ λ°”λ‘œ 밑에 μžˆλŠ” <p> 에 λŒ€ν•΄μ„œλ§Œ μ μš©λ˜λŠ” μŠ€νƒ€μΌμ„ μ •μ˜ν–ˆκ΅°μš”. bodyμ•ˆμ˜ divμ•ˆμ—μ„œ μ‚¬μš©λœ pνƒœκ·ΈλŠ” μœ„ μŠ€νƒ€μΌμ˜ μ μš©μ„ 받지 μ•ŠμŠ΅λ‹ˆλ‹€.

The Attribute Selectors ( 속성 μ…€λ ‰ν„° )

μ•„λž˜ μ˜ˆμ œλŠ” inputνƒœκ·Έμ˜ type속성이 text인 λ…€μ„λ“€μ˜ 색을 μ§€μ •ν•΄μ£ΌλŠ” μ˜ˆμ œμž…λ‹ˆλ‹€.

input[type="text"]{
  color: #000000; 
}

μœ„μ— μ •μ˜λœ μŠ€νƒ€μΌμ€ <input type="submit" /> μš”μ†Œμ—λŠ” 적용이 λ˜μ§€ μ•ŠλŠ”λ‹€λŠ” 것이죠.

μ•„λž˜λŠ” 속성 μ…€λ ‰ν„°μ˜ μ‚¬μš©λ²•μž…λ‹ˆλ‹€.

  • p[lang]lang 속성을 κ°–λŠ” λͺ¨λ“  λ¬Έλ‹¨μš”μ†Œλ₯Ό 선택.

  • p[lang="fr"] - lang attribute이 "fr"인 λͺ¨λ“  문단 μš”μ†Œλ₯Ό 선택.

  • p[lang~="fr"] - lang 속성이 "fr"을 ν¬ν•¨ν•˜λŠ” λͺ¨λ“  문단 μš”μ†Œλ₯Ό 선택.

  • p[lang|="en"] - lang 속성이 "en"μ΄κ±°λ‚˜ λ˜λŠ” "en"으둜 μ‹œμž‘ν•˜λŠ” 문단 μš”μ†Œλ₯Ό 선택.

Multiple Style Rules ( 닀쀑 μŠ€νƒ€μΌ κ·œμΉ™ )

μ§€κΈˆκΉŒμ§€λŠ” ν•˜λ‚˜μ˜ μš”μ†Œμ— ν•˜λ‚˜μ˜ μŠ€νƒ€μΌλ§Œ μ μš©μ„ ν–ˆμŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ μš”μ†Œλ§ˆλ‹€ μ—¬λŸ¬κ°œμ˜ 속성을 κ°€μ§ˆ 수 μžˆμœΌλ‹ˆ μ—¬λŸ¬κ°œμ˜ μŠ€νƒ€μΌμ„ 지정할 μˆ˜λ„ μžˆμ–΄μ•Όκ² μ£ ?  

h1 {
color: #36C;
font-weight: normal;
letter-spacing: .4em;
margin-bottom: 1em;
text-transform: lowercase;
}

μœ„ 예제처럼 μ„Έλ―Έμ½œλ‘  (;) 으둜 μŠ€νƒ€μΌμ„ κ΅¬λΆ„ν•˜μ—¬ μ •μ˜ν•΄μ£Όλ©΄ λ©λ‹ˆλ‹€. κ°„λ‹¨ν•˜μ£ ?

각 속성에 μ§€μ •λœ 속성값듀에 λŒ€ν•΄μ„œλŠ” 이게 λ­”κ°€ ν•˜μ‹€ μˆ˜λ„ μžˆλŠ”λ° μ‹ κ²½μ“°μ§€λ§ˆμ‹œκ³  일단 λ„˜μ–΄κ°€μ„Έμš”. μ°¨κ·Όμ°¨κ·Ό 배우면 λ©λ‹ˆλ‹€ ^___^ 

Grouping Selectors ( μ…€λ ‰ν„° κ·Έλ£Ήν™” )

λ‚΄κ°€ μ§€μ •ν•œ μŠ€νƒ€μΌμ„ μ—¬λŸ¬κ°œμ˜ μš”μ†Œμ— ν•œκΊΌλ²ˆμ—!!!!  μ μš©ν•˜κ³  μ‹ΆμœΌμ‹œλ‹€λ©΄!!!!

h1, h2, h3 {
color: #36C;
font-weight: normal;
letter-spacing: .4em;
margin-bottom: 1em;
text-transform: lowercase;
}

μœ„ μ˜ˆμ œλŠ” h1, h2 and h3 μš”μ†Œμ— ν•œκΊΌλ²ˆμ— μŠ€νƒ€μΌμ„ μ μš©μ‹œν‚€λŠ” μ˜ˆμ œμž…λ‹ˆλ‹€. μˆœμ„œλŠ” μ „ν˜€ 상관이 μ—†κ΅¬μš” 콀마λ₯Ό μ΄μš©ν•΄μ„œ 셀렉터듀을 κ΅¬λΆ„μ§€μ–΄μ£Όμ‹œλ©΄ λ˜κ² μŠ΅λ‹ˆλ‹€. μ•„λž˜μ²˜λŸΌ 아이디 μ…€λ ‰ν„°λ₯Ό μ΄μš©ν•  μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.

#content, #footer, #supplement {
position: absolute;
left: 510px;
width: 200px;
}

클래슀 μ…€λ ‰ν„°λ‚˜ λ‹€λ₯Έ 셀렉터듀을 ν•¨κ»˜ μ‚¬μš©ν•΄λ³΄λŠ” μ—°μŠ΅λ„ ν•΄λ³΄μ„Έμš” ^____^

 

 

 

 

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

 

 

 

 

 

 

'πŸ’» Programming > CSS' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€

[CSS] 6. Background ( λ°°κ²½ μ„€μ • )  (0) 2016.06.12
[CSS] 5. Colors ( 색깔 )  (0) 2016.06.12
[CSS] 4. Units ( λ‹¨μœ„ )  (0) 2016.06.12
[CSS] 3. HTML에 CSS링크 - Associating Styles with HTML  (0) 2016.06.12
[CSS] 1. CSSλž€ ?  (0) 2016.06.11

πŸ’» Programming/CSS

[CSS] 1. CSSλž€ ?

μ•ˆλ…•ν•˜μ„Έμš”~ μ΄λ²ˆμ—λŠ” CSS에 λŒ€ν•΄μ„œ μ•Œμ•„λ³Όν…λ°μš”~

 

CSSκ°€ 뭔지λ₯Ό μ•Œλ €λ©΄ 뭐의 μ•½μžμΈμ§€λΆ€ν„° μ•Œμ•„λ΄μ•Ό κ² μ£ ?

 

CSSλŠ” Cascading Style Sheets의 μ•½μžμž…λ‹ˆλ‹€. μΊμŠ€μΌ€μ΄λ”© μŠ€νƒ€μΌ μ‹œνŠΈ. μŠ€νƒ€μΌμ΄λΌλŠ” 단어라 λ“€μ–΄κ°”μœΌλ‹ˆ λ­”κ°€ μŠ€νƒ€μΌλ§ν•˜κΈ°μœ„ν•œ 어떀거라고 생각해볼 수 μžˆμœΌλ €λ‚˜μš”?  

 

CSSλŠ” htmlνƒœκ·Έλ‚΄μ˜ 속성값듀을 λ”°λ‘œ λΆ„λ¦¬ν•΄μ„œ μ €μž₯해놓기 μœ„ν•΄μ„œ μ‚¬μš©μ΄ λ©λ‹ˆλ‹€.

 

μ™œ λ”°λ‘œ μ €μž₯ν•΄λ†“μ„κΉŒμš”??

 

μ—¬λŸ¬ νŽ˜μ΄μ§€μ—μ„œ 적용이 λ˜μ•Όν•˜λŠ” μŠ€νƒ€μΌκ°’λ“€μ„ λΆ„λ¦¬ν•΄μ„œ μ €μž₯해놓고 μ—¬λŸ¬ νŽ˜μ΄μ§€μ—μ„œ κ·Έλƒ₯ ν˜ΈμΆœν•΄μ„œ μ‚¬μš©ν•˜κΈ° λ•Œλ¬Έμ— μž¬μ‚¬μš©μ„±μ΄ 높아지고 λ˜‘κ°™μ€ 속성을 νƒ€μ΄ν•‘ν•΄μ•Όν•˜λŠ” μˆ˜κ³ λ„ 덜 수 있으며 μ‹œκ°„λ„ 단좕될 것이고 μœ μ§€λ³΄μˆ˜λ„ μ‰¬μ›Œμ§€κ² μ£ ?

 

κ·Έλž˜μ„œ 점점 htmlλ‚΄μ˜ 속성듀이 사라지고 λŒ€μ‹  CSSλ₯Ό μ΄μš©ν•˜λŠ” 것이 ν‘œμ€€μ΄ λ κ±°λΌλŠ” 말도 μžˆμŠ΅λ‹ˆλ‹€.

(2020λ…„ ν˜„μž¬ 이미 κ·Έλ ‡κ²Œ λ˜μ–΄λ²„λ ΈμŠ΅λ‹ˆλ‹€. html 내에 inline style을 μ •μ˜ν•΄μ„œ μ“°λŠ” 일은 거의 μ—†μ£ )

 

 

그러면 기본적인 문법을 μ—¬κΈ°μ„œ ν•œλ²ˆ 짚고 λ„˜μ–΄κ°€λ³ΌκΉŒμš”??

 

에이 κ·Έλƒ₯ λ‹€μŒμ— μ•Œμ•„λ³΄κΈ°λ‘œ ν•˜μ£  γ…‹γ…‹