CSS HEX ﯼﺎﻫ ﮓﻧﺭ


فهرست مطالب

    نمایش فهرست مطالب


RR ﻪﮐ ﯽﯾﺎﺟ ،ﺩﻮﺷ ﯽﻣ ﺺﺨﺸﻣ RRGGBB# :ﺎﺑ ﻝﺎﻤﯿﺳﺩ ﺍﺰﮕﻫ ﮓﻧﺭ ﮏﯾ


HEX ﺭﺍﺪﻘﻣ

:ﺩﺮﮐ ﺺﺨﺸﻣ ﺮﯾﺯ ﻞﮑﺷ ﻪﺑ ﻝﺎﻤﯿﺳﺩﺍﺰﮕﻫ ﺭﺍﺪﻘﻣ ﮏﯾ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ ﻥﺍﻮﺗ ﯽﻣ ﺍﺭ ﮓﻧﺭ ﮏﯾ ،CSS

#rrggbb

.(255-0 ﯼﺭﺎﺸﻋﺍ ﻥﺎﻤﻫ) ﺪﻨﺘﺴﻫ ff ﻭ 00 ﻦﯿﺑ ﻝﺎﻤﯿﺳﺩﺍﺰﮕﻫ ﺮﯾﺩﺎﻘﻣ (ﯽﺑﺁ) bb ﻭ (ﺰﺒﺳ) gg ،

ﯼﻭﺭ ﻪﯿﻘﺑ ﻭ (ff) ﺩﻮﺧ ﺭﺍﺪﻘﻣ ﻦﯾﺮﺗﻻﺎﺑ ﻪﺑ ﺰﻣﺮﻗ ﺍﺮﯾﺯ ،ﺩﻮﺷ ﯽﻣ ﻩﺩﺍﺩ ﺶﯾﺎﻤﻧ ﺰﻣﺮﻗ ﺕﺭﻮﺻ ﻪﺑ

.000000# :ﺪﻨﻧﺎﻣ ،ﺪﯿﻨﮐ ﻢﯿﻈﻨﺗ 00 ﯼﻭﺭ ﺍﺭ ﺮﯾﺩﺎﻘﻣ ﻪﻤﻫ ،ﯽﮑﺸﻣ ﺶﯾﺎﻤﻧ ﯼﺍﺮﺑ

ﺪﯿﻨﮐ ﻢﯿﻈﻨﺗ ff ﯼﻭﺭ ﺍﺭ ﺮﯾﺩﺎﻘﻣ ﻡﺎﻤﺗ ،ﺪﯿﻔﺳ ﮓﻧﺭ ﺶﯾﺎﻤﻧ ﯼﺍﺮﺑ

:ﺪﯿﻨﮐ ﺶﯾﺎﻣﺯﺁ ﺮﯾﺯ HEX ﺮﯾﺩﺎﻘﻣ ﻥﺩﺮﮐ ﻁﻮﻠﺨﻣ ﺎﺑ

 

RED

ff

GREEN

0

BLUE

0

ﻝﺎﺜﻣ

#ff0000
#0000ff
#3cb371
#ee82ee
#ffa500
#6a5acd

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>Specify colors using HEX values</h1>

<h2 style="background-color:#ff0000;">#ff0000</h2>
<h2 style="background-color:#0000ff;">#0000ff</h2>
<h2 style="background-color:#3cb371;">#3cb371</h2>
<h2 style="background-color:#ee82ee;">#ee82ee</h2>
<h2 style="background-color:#ffa500;">#ffa500</h2>
<h2 style="background-color:#6a5acd;">#6a5acd</h2>

</body>
</html>


:ﺪﻧﻮﺷ ﯽﻣ ﻒﯾﺮﻌﺗ ﺭﻮﻧ ﻊﺒﻨﻣ 3 ﺮﻫ ﯼﺍﺮﺑ ﯼﻭﺎﺴﻣ ﺮﯾﺩﺎﻘﻣ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ ﺐﻠﻏﺍ ﯼﺮﺘﺴﮐﺎﺧ ﯼﺎﻫ

ﻝﺎﺜﻣ

#3c3c3c
#616161
#787878
#b4b4b4
#f0f0f0
#f9f9f9

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>Shades of gray</h1>

<p>By using equal values for red, green, and blue, you will get different shades of gray:</p>

<h2 style="background-color:#3c3c3c;">#3c3c3c</h2>
<h2 style="background-color:#616161;">#616161</h2>
<h2 style="background-color:#787878;">#787878</h2>
<h2 style="background-color:#b4b4b4;">#b4b4b4</h2>
<h2 style="background-color:#f0f0f0;">#f0f0f0</h2>
<h2 style="background-color:#f9f9f9;">#f9f9f9</h2>

</body>
</html>




HEX ﯽﻤﻗﺭ 3 ﺭﺍﺪﻘﻣ

.ﺪﯿﻨﮐ ﯽﻣ ﻩﺪﻫﺎﺸﻣ CSS ﻊﺒﻨﻣ ﺭﺩ ﯽﻤﻗﺭ 3 ﺰﮕﻫ ﺪﮐ ﮏﯾ ﺕﺎﻗﻭﺍ ﯽﻫﺎﮔ

.ﺖﺳﺍ ﯽﻤﻗﺭ 6 ﯽﻤﻗﺭ ﺶﺷ ﯼﺎﻫﺪﮐ ﺯﺍ ﯽﺧﺮﺑ ﺮﺼﺘﺨﻣ ﯽﻤﻗﺭ 3 ﺰﮕﻫ ﺪﮐ

:ﺖﺳﺍ ﺮﯾﺯ ﻞﮑﺷ ﻪﺑ ﯽﻤﻗﺭ 3 ﺰﮕﻫ ﺪﮐ

#rgb

.ﺪﻨﺘﺴﻫ f ﻭ 0 ﻦﯿﺑ ﺮﯾﺩﺎﻘﻣ ﺎﺑ ﯽﺑﺁ ﻭ ﺰﺒﺳ ،ﺰﻣﺮﻗ ﯼﺎﻫ ﻪﻔﻟﻮﻣ ﻩﺪﻨﻫﺩ ﻥﺎﺸﻧ b ﻭ r، g ﻪﮐ ﯽﯾ

.ﺪﻨﺷﺎﺑ ﻥﺎﺴﮑﯾ ﯼﺍﺮﺑ (BB ﻭ RR، GG) ﺭﺍﺪﻘﻣ ﻭﺩ ﺮﻫ ﻪﮐ ﺖﺳﺍ ﻩﺩﺎﻔﺘﺳﺍ ﻞﺑﺎﻗ ﯽﻧﺎﻣﺯ ﻂﻘﻓ ﯽﻤﻗﺭ

:ﻝﺎﺜﻣ ﻥﺍﻮﻨﻋ ﻪﺑ

ﻝﺎﺜﻣ

 body {
  background-color: #fc9; /* same as #ffcc99 */
}
h1 {
  
  color: #f0f; /* same as #ff00ff */
}
p {
  
  color: #b58; /* same as #bb5588 */
} 

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<head>
<style>
body {
  background-color: #fc9; /* same as #ffcc99 */
}

h1 {
  color: #f0f; /* same as #ff00ff */
}

p {
  color: #b58; /* same as #bb5588 */
}
</style>
</head>
<body>

<h1>CSS 3-digit Hex Code</h1>
<p>This is a paragraph.</p>

</body>
</html>