CSS ﯽﻋﺎﻌﺷ ﯼﺎﻫ ﻥﺎﯾﺩﺍﺮﮔ


فهرست مطالب

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


CSS ﯽﻋﺎﻌﺷ ﯼﺎﻫ ﻥﺎﯾﺩﺍﺮﮔ

.ﺩﻮﺷ ﯽﻣ ﻒﯾﺮﻌﺗ ﻥﺁ ﺰﮐﺮﻣ ﺎﺑ ﯽﻋﺎﻌﺷ ﻥﺎﯾﺩﺍﺮﮔ ﮏﯾ

.ﺪﯿﻨﮐ ﻒﯾﺮﻌﺗ ﮓﻧﺭ ﻒﻗﻮﺗ ﻭﺩ ﻞﻗﺍﺪﺣ ﺪﯾﺎﺑ ﺰﯿﻧ ﯽﻋﺎﻌﺷ ﻥﺎﯾﺩﺍﺮﮔ ﮏﯾ ﺩﺎﺠﯾﺍ ﯼﺍﺮﺑ

ﻮﺤﻧ

background-image: radial-gradient(shape size at position, start-color, ..., last-color);

.ﺖﺳﺍ ﺰﮐﺮﻣ ﺖﯿﻌﻗﻮﻣ ﻭ ﻪﺷﻮﮔ ﻦﯾﺮﺗﺭﻭﺩ ﻩﺯﺍﺪﻧﺍ ،ﯽﻀﯿﺑ ﻞﮑﺷ ،ﺽﺮﻓ ﺶﯿﭘ ﺭﻮﻃ ﻪﺑ

(ﺖﺳﺍ ﺽﺮﻓ ﺶﯿﭘ ﻦﯾﺍ) ﺩﻮﺷ ﯽﻣ ﻒﻗﻮﺘﻣ ﺖﺧﺍﻮﻨﮑﯾ ﻪﻠﺻﺎﻓ ﺎﺑ ﮓﻧﺭ - ﯽﻋﺎﻌﺷ ﻥﺎﯾﺩﺍﺮﮔ

:ﺪﻫﺩ ﯽﻣ ﻥﺎﺸﻧ ﺍﺭ ﺖﺧﺍﻮﻨﮑﯾ ﻪﻠﺻﺎﻓ ﺎﺑ ﯽﮕﻧﺭ ﯼﺎﻫ ﻒﻗﻮﺗ ﺎﺑ ﯽﻋﺎﻌﺷ ﻥﺎﯾﺩﺍﺮﮔ ﮏﯾ ﺮﯾﺯ ﻝﺎﺜﻣ

ﻝﺎﺜﻣ

   #grad {
  background-image: radial-gradient(red, yellow, green);
} 

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

<!DOCTYPE html>
<html>
<head>
<style>
#grad1 {
  height: 150px;
  width: 200px;
  background-color: red; /* For browsers that do not support gradients */
  background-image: radial-gradient(red, yellow, green);
}
</style>
</head>
<body>

<h1>Radial Gradient - Evenly Spaced Color Stops</h1>

<div id="grad1"></div>

</body>
</html>


ﺩﻮﺷ ﯽﻣ ﻒﻗﻮﺘﻣ ﺕﻭﺎﻔﺘﻣ ﻪﻠﺻﺎﻓ ﺎﺑ ﮓﻧﺭ - ﯽﻋﺎﻌﺷ ﻥﺎﯾﺩﺍﺮﮔ

:ﺪﻫﺩ ﯽﻣ ﻥﺎﺸﻧ ﺍﺭ ﺕﻭﺎﻔﺘﻣ ﻪﻠﺻﺎﻓ ﺎﺑ ﯽﮕﻧﺭ ﯼﺎﻫ ﻒﻗﻮﺗ ﺎﺑ ﯽﻋﺎﻌﺷ ﻥﺎﯾﺩﺍﺮﮔ ﮏﯾ ﺮﯾﺯ ﻝﺎﺜﻣ

ﻝﺎﺜﻣ

   #grad {
  background-image: radial-gradient(red 5%, yellow 15%, green 60%);
} 

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

<!DOCTYPE html>
<html>
<head>
<style>
#grad1 {
  height: 150px;
  width: 200px;
  background-color: red; /* For browsers that do not support gradients */
  background-image: radial-gradient(red 5%, yellow 15%, green 60%);
}
</style>
</head>
<body>

<h1>Radial Gradient - Differently Spaced Color Stops</h1>

<div id="grad1"></div>

</body>
</html>



ﻞﮑﺷ ﻢﯿﻈﻨﺗ

.ﺖﺳﺍ ﯽﻀﯿﺑ ﺽﺮﻓ ﺶﯿﭘ ﺭﺍﺪﻘﻣ .ﺩﺮﯿﮕﺑ ﺍﺭ ﺭﺍﺪﻘﻣ ﯽﻀﯿﺑ ﺎﯾ ﻩﺮﯾﺍﺩ ﺪﻧﺍﻮﺗ ﯽﻣ .ﺪﻨﮐ ﯽﻣ ﺺﺨﺸﻣ ﺍﺭ

:ﺪﻫﺩ ﯽﻣ ﻥﺎﺸﻧ ﺍﺭ ﻩﺮﯾﺍﺩ ﻞﮑﺷ ﺎﺑ ﯽﻋﺎﻌﺷ ﻥﺎﯾﺩﺍﺮﮔ ﮏﯾ ﺮﯾﺯ ﻝﺎﺜﻣ

ﻝﺎﺜﻣ

   #grad {
  background-image: radial-gradient(circle, red, yellow, green);
} 

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

<!DOCTYPE html>
<html>
<head>
<style>
#grad1 {
  height: 150px;
  width: 200px;
  background-color: red; /* For browsers that do not support gradients */
  background-image: radial-gradient(red, yellow, green);
}

#grad2 {
  height: 150px;
  width: 200px;
  background-color: red; /* For browsers that do not support gradients */
  background-image: radial-gradient(circle, red, yellow, green);
}
</style>
</head>
<body>

<h1>Radial Gradient - Shapes</h1>

<h2>Ellipse (this is default):</h2>
<div id="grad1"></div>

<h2><strong>Circle:</strong></h2>
<div id="grad2"></div>

</body>
</html>




ﻒﻠﺘﺨﻣ ﯼﺎﻫ ﻩﺯﺍﺪﻧﺍ ﺎﺑ ﯼﺪﯿﻠﮐ ﺕﺎﻤﻠﮐ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ

:ﺪﺷﺎﺑ ﻪﺘﺷﺍﺩ ﺭﺍﺪﻘﻣ ﺭﺎﻬﭼ ﺪﻧﺍﻮﺗ ﯽﻣ .ﺪﻨﮐ ﯽﻣ ﺺﺨﺸﻣ ﺍﺭ ﻥﺎﯾﺩﺍﺮﮔ ﻩﺯﺍﺪﻧﺍ size

closest-side
farthest-side
closest-corner
farthest-corner

ﻝﺎﺜﻣ

:ﻒﻠﺘﺨﻣ ﯼﺎﻫ ﻩﺯﺍﺪﻧﺍ ﺎﺑ ﯼﺪﯿﻠﮐ ﺕﺎﻤﻠﮐ ﺎﺑ ﯽﻋﺎﻌﺷ ﻥﺎﯾﺩﺍﺮﮔ ﮏﯾ

   #grad1 {
  background-image: radial-gradient(closest-side at 60% 55%, red, yellow, 
black);
}

#grad2 {
      background-image: radial-gradient(farthest-side at 60% 
55%, red, yellow, black);
} 

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

<!DOCTYPE html>
<html>
<head>
<style>
#grad1 {
  height: 150px;
  width: 150px;
  background-color: red; /* For browsers that do not support gradients */
  background-image: radial-gradient(closest-side at 60% 55%, red, yellow, black);
}

#grad2 {
  height: 150px;
  width: 150px;
  background-color: red; /* For browsers that do not support gradients */
  background-image: radial-gradient(farthest-side at 60% 55%, red, yellow, black);
}

#grad3 {
  height: 150px;
  width: 150px;
  background-color: red; /* For browsers that do not support gradients */
  background-image: radial-gradient(closest-corner at 60% 55%, red, yellow, black);
}

#grad4 {
  height: 150px;
  width: 150px;
  background-color: red; /* For browsers that do not support gradients */
  background-image: radial-gradient(farthest-corner at 60% 55%, red, yellow, black);
}
</style>
</head>
<body>

<h1>Radial Gradients - Different size keywords</h1>

<h2>closest-side:</h2>
<div id="grad1"></div>

<h2>farthest-side:</h2>
<div id="grad2"></div>

<h2>closest-corner:</h2>
<div id="grad3"></div>

<h2>farthest-corner (default):</h2>
<div id="grad4"></div>

</body>
</html>



ﯽﻋﺎﻌﺷ ﻥﺎﯾﺩﺍﺮﮔ ﺭﺍﺮﮑﺗ

:ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﯽﻋﺎﻌﺷ ﯼﺎﻫ ﻥﺎﯾﺩﺍﺮﮔ ﺭﺍﺮﮑﺗ ﯼﺍﺮﺑ repeating-radial-gradient()

ﻝﺎﺜﻣ

:ﻩﺪﻧﻮﺷ ﺭﺍﺮﮑﺗ ﯽﻋﺎﻌﺷ ﻥﺎﯾﺩﺍﺮﮔ ﮏﯾ

   #grad {
  background-image: 
repeating-radial-gradient(red, yellow 10%, green 15%);
} 

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

<!DOCTYPE html>
<html>
<head>
<style>
#grad1 {
  height: 150px;
  width: 200px;
  background-color: red; /* For browsers that do not support gradients */
  background-image: repeating-radial-gradient(red, yellow 10%, green 15%);
}
</style>
</head>
<body>

<h1>Repeating Radial Gradient</h1>

<div id="grad1"></div>

</body>
</html>



تمامی حقوق محفوظ است. © BasicIT.org • 2023-2024