CSS !important Property


فهرست مطالب

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


؟ﺖﺳﺍ ﻢﻬﻣ ﯼﺰﯿﭼ ﻪﭼ

.ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﻝﻮﻤﻌﻣ ﺪﺣ ﺯﺍ ﺶﯿﺑ ﺭﺍﺪﻘﻣ/ﯽﮔﮋﯾﻭ ﮏﯾ ﻪﺑ ﺮﺘﺸﯿﺑ ﺖﯿﻤﻫﺍ ﻥﺩﻭﺰﻓﺍ ﯼﺍﺮﺑ CSS

.ﺪﻨﮐ ﯽﻣ ﻮﻐﻟ ﺍﺭ ﯽﻠﺒﻗ ﯼﺯﺎﺳ ﻞﯾﺎﺘﺳﺍ ﻦﯿﻧﺍﻮﻗ ﻪﻤﻫ ،ﺪﯿﻨﮐ ﻩﺩﺎﻔﺘﺳﺍ

ﻝﺎﺜﻣ

#myid {
  background-color: blue;
}
.myclass {
  
  background-color: gray;
}
p {
  background-color: red !important;
}

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

<!DOCTYPE html>
<html>
<head>
<style>
#myid {
  background-color: blue;
}

.myclass {
  background-color: gray;
}

p {
  background-color: red !important;
}
</style>
</head>
<body>

<p>This is some text in a paragraph.</p>

<p class="myclass">This is some text in a paragraph.</p>

<p id="myid">This is some text in a paragraph.</p>

</body>
</html>


ﺪﺷ ﻩﺩﺍﺩ ﺢﯿﺿﻮﺗ ﻝﺎﺜﻣ

.ﺪﻨﮐﯽﻣ ﻮﻐﻟ ﺩﺭﻮﻣ ﻭﺩ ﺮﻫ ﺭﺩ ﺍﺭ background-color


important! ﻩﺭﺎﺑﺭﺩ ﻢﻬﻣ

!important ﮏﯾ ﻮﻐﻟ ﯼﺍﺮﺑ ﻩﺍﺭ ﺎﻬﻨﺗ

ﺖﺴﯿﻧ ﺢﺿﺍﻭ ﯽﻠﯿﺧ ﺪﯿﻨﮐ ﯽﻣ ﻩﺎﮕﻧ ﯽﺘﻗﻭ .ﻢﯾﺍ ﻩﺩﺮﮐ ﺩﺎﺠﯾﺍ ﻩﺩﺎﺳ ﻝﺎﺜﻣ ﮏﯾ ﺎﻣ ﺎﺠﻨﯾﺍ ﺭﺩ

ﻝﺎﺜﻣ

 #myid {
  background-color: blue !important;
}
.myclass {
  
  background-color: gray !important;
}
p {
  background-color: red !important;
}

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

<!DOCTYPE html>
<html>
<head>
<style>
#myid {
  background-color: blue !important;
}

.myclass {
  background-color: gray !important;
}

p {
  background-color: red !important;
}
</style>
</head>
<body>

<p>This is some text in a paragraph.</p>

<p class="myclass">This is some text in a paragraph.</p>

<p id="myid">This is some text in a paragraph.</p>

</body>
</html>


ﻪﺘﮑﻧ: ﻩﺭﺎﺑﺭﺩ ﺖﺳﺍ ﺏﻮﺧ !important



important! ﺯﺍ ﻪﻧﺎﻔﺼﻨﻣ ﻩﺩﺎﻔﺘﺳﺍ ﻭﺩ ﺎﯾ ﮏﯾ ﺪﯾﺎﺷ

ﻮﻐﻟ ﻪﺑ ﺭﻮﺒﺠﻣ ﻪﮐ ﺖﺳﺍ ﻦﯾﺍ !important ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ

ﺎﻤﺷ ﺪﯿﻨﮐ ﺽﺮﻓ :ﺖﺳﺍ ﻦﯾﺍ !important ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﯼ

ﻝﺎﺜﻣ

 .button {
  background-color: #8c8c8c; 
  color: white;
  
  padding: 5px;
  border: 1px solid black; 
}

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

<!DOCTYPE html>
<html>
<head>
<style>
.button {
  background-color: #8c8c8c; 
  color: white;
  padding: 5px;
  border: 1px solid black; 
}
</style>
</head>
<body>

<p>Standard button: <a class="button" href="default.asp">CSS Tutorial</a></p>

<p>Standard button: <a class="button" href="/html/">HTML Tutorial</a></p>

</body>
</html>


ﻢﯿﻫﺩ ﺭﺍﺮﻗ ﯼﺮﮕﯾﺩ ﺮﺼﻨﻋ ﻞﺧﺍﺩ ﺍﺭ ﻥﺁ ﺮﮔﺍ ﺪﻨﮐ ﺮﯿﯿﻐﺗ ﺪﻧﺍﻮﺗ ﯽﻣ ﺕﺎﻗﻭﺍ ﯽﻫﺎﮔ ﻪﻤﮐﺩ ﮏﯾ ﺮﻫﺎﻇ

ﻝﺎﺜﻣ

 .button {
  background-color: #8c8c8c; 
  color: white;
  
  padding: 5px;
  border: 1px solid black; 
}
#myDiv a {
  
  color: red;
  background-color: yellow; 
}

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

<!DOCTYPE html>
<html>
<head>
<style>
.button {
  background-color: #8c8c8c; 
  color: white;
  padding: 5px;
  border: 1px solid black; 
}

#myDiv a {
  color: red;
  background-color: yellow;  
}
</style>
</head>
<body>

<p>Standard button: <a class="button" href="default.asp">CSS Tutorial</a></p>

<div id="myDiv">
<p>A link text inside myDiv: <a href="/html/">HTML Tutorial</a></p>
<p>A link button inside myDiv: <a href="/html/" class="button">HTML Tutorial</a></p>
</div>

</body>
</html>


.ﻢﯿﻨﮐ ﻪﻓﺎﺿﺍ ﺍﺭ !important ﻢﯿﻧﺍﻮﺗ ﯽﻣ ،ﺪﺷﺎﺑ ﻪﭼ

ﻝﺎﺜﻣ

 .button {
  background-color: #8c8c8c !important; 
  color: white 
  !important;
  
  padding: 5px !important;
  border: 1px solid black !important; 
}
#myDiv a {
  
  color: red;
  background-color: yellow; 
}

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

<!DOCTYPE html>
<html>
<head>
<style>
.button {
  background-color: #8c8c8c !important; 
  color: white !important;
  padding: 5px !important;
  border: 1px solid black !important; 
}

#myDiv a {
  color: red;
  background-color: yellow;  
}
</style>
</head>
<body>

<p>Standard button: <a class="button" href="default.asp">CSS Tutorial</a></p>

<div id="myDiv">
<p>A link text inside myDiv: <a href="/html/">HTML Tutorial</a></p>
<p>A link button inside myDiv: <a href="/html/" class="button">HTML Tutorial</a></p>
</div>

</body>
</html>


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