CSS ﯽﮕﻧﺭ ﯼﺪﯿﻠﮐ ﺕﺎﻤﻠﮐ


فهرست مطالب

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


:ﺪﻫﺩ ﯽﻣ ﺢﯿﺿﻮﺗ ﺍﺭ ﯼﺪﯿﻠﮐ ﺕﺎﻤﻠﮐ ﻪﺤﻔﺻ ﻦﯾﺍ

transparent
currentcolor
inherit

ﻑﺎﻔﺷ ﯼﺪﯿﻠﮐ ﻪﻤﻠﮐ

ﮏﯾ ﺩﺎﺠﯾﺍ ﯼﺍﺮﺑ ﻑﺎﻔﺷ<"code class="w3-codespan> ﯼﺪﯿﻠﮐ ﻪﻤﻠﮐ

ﻝﺎﺜﻣ

ﺩﻮﺑ ﺪﻫﺍﻮﺧ ﻞﻣﺎﮐ ﺭﻮﻃ ﻪﺑ <div> ﺮﺼﻨﻋ ﻪﻨﯿﻣﺯ ﺲﭘ ﮓﻧﺭ ،ﺎﺠﻨﯾﺍ ﺭﺩ

 body {
  background-image: url("paper.gif");
}
div { 
  
  background-color: transparent;
} 

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

<!DOCTYPE html>
<html>
<head>
<style>
body {
  background-image: url("paper.gif");
}

div.ex1 { 
  background-color: lightgreen;
  border: 2px solid black;
  padding: 15px;
}

div.ex2 { 
  background-color: transparent;
  border: 2px solid black;
  padding: 15px;
} 
</style>
</head>
<body>

<h2>The transparent Keyword</h2>

<div class="ex1">This div has a light green background.</div>
<br>
<div class="ex2">This div has a transparent background.</div>

</body>
</html>


ﻪﺟﻮﺗ: ﻑﺎﻔﺷ


ﮓﻧﺭ ﯽﻠﻌﻓ ﯼﺪﯿﻠﮐ ﻪﻤﻠﮐ

ﺖﺳﺍ ﺮﯿﻐﺘﻣ ﮏﯾ ﺪﻨﻧﺎﻣ currentcolor ﯼﺪﯿﻠﮐ ﻪﻤﻠﮐ

ﺪﺷﺎﺑ ﺪﯿﻔﻣ ﺪﻧﺍﻮﺗ ﯽﻣ ﯼﺪﯿﻠﮐ ﻪﻤﻠﮐ ﻦﯾﺍ ،ﺪﺷﺎﺑ ﺖﺑﺎﺛ ﮓﻧﺭ ﮏﯾ ﺭﺩ ﯽﺻﺎﺧ ﮓﻧﺭ ﺪﯿﻫﺍﻮﺧ ﯽﻣ ﺮﮔﺍ

ﻝﺎﺜﻣ

ﺍﺮﯾﺯ ،ﺩﻮﺑ ﺪﻫﺍﻮﺧ ﯽﺑﺁ <div> ﺮﺼﻨﻋ ﻪﯿﺷﺎﺣ ﮓﻧﺭ ﻝﺎﺜﻣ ﻦﯾﺍ ﺭﺩ

 div {
  color: blue;
  border: 10px solid currentcolor;
}

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

<!DOCTYPE html>
<html>
<head>
<style>
div {
  color: blue;
  border: 10px solid currentcolor;
  padding: 15px;  
}
</style>
</head>
<body>

<h2>The currentcolor Keyword</h2>

<p>The currentcolor keyword refers to the current value of the color property of an element.</p>

<div>
This div element has a blue text color and a blue border.
</div>

</body>
</html>


ﻝﺎﺜﻣ

ﺖﺳﺍ ﻩﺪﺷ ﻢﯿﻈﻨﺗ ﯽﻠﻌﻓ ﮓﻧﺭ ﯼﻭﺭ <div> ﻪﻨﯿﻣﺯ ﺲﭘ ﮓﻧﺭ ﻝﺎﺜﻣ ﻦﯾﺍ ﺭﺩ

 body {
  color: purple;
}
div {
  background-color: 
  currentcolor;
}

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

<!DOCTYPE html>
<html>
<head>
<style>
body {
  color: purple;
}

div {
  background-color: currentcolor;
  padding: 15px;
}

div p {
  color: white;
}
</style>
</head>
<body>

<h2>The currentcolor Keyword</h2>

<p>This is some text in the body part...</p>

<div>
<p>This div's background color is set to the current color value of the body element.</p>
</div>

</body>
</html>


ﻝﺎﺜﻣ

ﺖﺳﺍ ﻩﺪﺷ ﻢﯿﻈﻨﺗ ﯼﻭﺭ <div> ﻪﯾﺎﺳ ﮓﻧﺭ ﻭ ﻪﯿﺷﺎﺣ ﮓﻧﺭ ﻝﺎﺜﻣ ﻦﯾﺍ ﺭﺩ

 body {
 color: green;
}
div { 
  box-shadow: 0px 0px 
  15px currentcolor;
  border: 5px solid currentcolor;
}

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

<!DOCTYPE html>
<html>
<head>
<style>
body {
  color: green;
}

div { 
  box-shadow: 0px 0px 15px currentcolor;
  border: 5px solid currentcolor;
  padding: 15px;
}
</style>
</head>
<body>

<h2>The currentcolor Keyword</h2>

<p>This is some text in the body part...</p>

<div>
<p>This div's border color and shadow color is set to the current color value of the body element.</p>
</div>

</body>
</html>



ﯼﺮﺑ ﺙﺭﺍ ﯼﺪﯿﻠﮐ ﻪﻤﻠﮐ

ﻪﮐ ﺪﻨﮐ ﯽﻣ ﺺﺨﺸﻣ ﯼﺮﺑ ﺙﺭﺍ<"code class="w3-codespan> ﯼﺪﯿﻠﮐ ﻪﻤﻠﮐ

ﺩﺮﮐ ﻩﺩﺎﻔﺘﺳﺍ CSS ﺮﻫ ﯼﺍﺮﺑ ﻥﺍﻮﺗ ﯽﻣ ﺍﺭ ﯼﺮﺑ ﺙﺭﺍ<"code class="w3-codespan> ﯼﺪ

ﻝﺎﺜﻣ

ﺩﻮﺷ ﯽﻣ ﻩﺩﺮﺑ ﺙﺭﺍ ﻪﺑ ﻥﺁ ﺯﺍ <span> ﻪﯿﺷﺎﺣ ﺕﺎﻤﯿﻈﻨﺗ ﻝﺎﺜﻣ ﻦﯾﺍ ﺭﺩ

 div {
  border: 2px solid red;
}
span {
  border: 
  inherit;
}

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

<!DOCTYPE html>
<html>
<head>
<style>
div {
  border: 2px solid red;
}

span {
  border: inherit;
}
</style>
</head>
<body>

<h2>The inherit Keyword</h2>

<div>Here, the <span>span element's</span> border settings will be inherited from the parent element.</div>
<br>

<div style="border:2px dotted blue;">Here, the <span>span element's</span> border settings will also be inherited from the parent element.</div>

</body>
</html>


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