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