.ﺩﺭﺍﺩ ﺩﻮﺟﻭ ،ﺪﻨﺘﺴﻫ ﻪﺼﺨﺸﻣ ﺮﯾﺩﺎﻘﻣ ﺎﯾ ﺎﻫ ﯽﮔﮋﯾﻭ ﯼﺍﺭﺍﺩ ﻪﮐ HTML ﺮﺻﺎﻨﻋ ﻪﺑ ﻥﺩﺍﺩ ﻞﯾﺎﺘﺳﺍ
ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﻩﺪﺷ ﺺﺨﺸﻣ ﮏﯾ ﺎﺑ ﺮﺻﺎﻨﻋ ﺏﺎﺨﺘﻧﺍ ﯼﺍﺮﺑ [ﯽﮔﮋﯾﻭ]<"code class="w3
:ﺪﻨﮐ ﯽﻣ ﺏﺎﺨﺘﻧﺍ ﻑﺪﻫ ﯽﮔﮋﯾﻭ ﺎﺑ ﺍﺭ <a> ﺮﺻﺎﻨﻋ ﻡﺎﻤﺗ ﺮﯾﺯ ﻝﺎﺜﻣ
a[target] {
background-color: yellow;
}
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<head>
<style>
a[target] {
background-color: yellow;
}
</style>
</head>
<body>
<h2>CSS [attribute] Selector</h2>
<p>The links with a target attribute gets a yellow background:</p>
<a href="https://www.w3schools.com">w3schools.com</a>
<a href="http://www.disney.com" target="_blank">disney.com</a>
<a href="http://www.wikipedia.org" target="_top">wikipedia.org</a>
</body>
</html>
ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﻩﺪﺷ ﺺﺨﺸﻣ ﮏﯾ ﺎﺑ ﺮﺻﺎﻨﻋ ﺏﺎﺨﺘﻧﺍ ﯼﺍﺮﺑ [att
:ﺪﻨﮐ ﯽﻣ ﺏﺎﺨﺘﻧﺍ "target="_blank ﯽﮔﮋﯾﻭ ﺎﺑ ﺍﺭ <a> ﺮﺻﺎﻨﻋ ﻪﻤﻫ ﺮﯾﺯ ﻝﺎﺜﻣ
a[target="_blank"] {
background-color: yellow;
}
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<head>
<style>
a[target="_blank"] {
background-color: yellow;
}
</style>
</head>
<body>
<h2>CSS [attribute="value"] Selector</h2>
<p>The link with target="_blank" gets a yellow background:</p>
<a href="https://www.w3schools.com">w3schools.com</a>
<a href="http://www.disney.com" target="_blank">disney.com</a>
<a href="http://www.wikipedia.org" target="_top">wikipedia.org</a>
</body>
</html>
.ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﯽﮔﮋﯾﻭ ﮏﯾ ﯼﺍﺭﺍﺩ ﺮﺻﺎﻨﻋ ﺏﺎﺨﺘﻧﺍ ﯼﺍﺮﺑ [at
ﺪﻨﮐ ﯽﻣ ﺏﺎﺨﺘﻧﺍ ﻥﺍﻮﻨﻋ ﯽﮔﮋﯾﻭ ﺎﺑ ﺍﺭ ﺮﺻﺎﻨﻋ ﻪﻤﻫ ﺮﯾﺯ ﻝﺎﺜﻣ
[title~="flower"] {
border: 5px solid yellow;
}
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<head>
<style>
[title~="flower"] {
border: 5px solid yellow;
}
</style>
</head>
<body>
<h2>CSS [attribute~="value"] Selector</h2>
<p>All images with the title attribute containing the word "flower" get a yellow border.</p>
<img src="klematis.jpg" title="klematis flower" width="150" height="113">
<img src="img_flwr.gif" title="flower" width="224" height="162">
<img src="img_tree.gif" title="tree" width="200" height="358">
</body>
</html>
ﺩﺍﺩ ﺪﻫﺍﻮﺧ ﺖﻘﺑﺎﻄﻣ title="flower"، title="summer ﺎﺑ ﺍﺭ ﺮﺻﺎﻨﻋ ﻻﺎﺑ ﻝﺎﺜﻣ
["ﺭﺍﺪﻘﻣ"=|ﻪﺼﯿﺼﺧ]<"code class="w3-codespan> ﺮﮕﺑﺎﺨﺘﻧﺍ
ﻪﺟﻮﺗ: ﺪﻨﻧﺎﻣ ،ﯽﯾﺎﻬﻨﺗ ﻪﺑ ﺎﯾ ،ﺪﺷﺎﺑ ﻞﻣﺎﮐ ﻪﻤﻠﮐ ﮏﯾ ﺪﯾﺎﺑ ﺭﺍﺪﻘﻣ
[class|="top"] {
background: yellow;
}
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<head>
<style>
[class|="top"] {
background: yellow;
}
</style>
</head>
<body>
<h2>CSS [attribute|="value"] Selector</h2>
<h1 class="top-header">Welcome</h1>
<p class="top-text">Hello world!</p>
<p class="topcontent">Are you learning CSS?</p>
</body>
</html>
[attribute^="value"]
ﺮﮕﺑﺎﺨﺘﻧﺍ
ﻪﮐ ﺪﻨﮐ ﯽﻣ ﺏﺎﺨﺘﻧﺍ ﺱﻼﮐ ﻪﺼﺨﺸﻣ ﺭﺍﺪﻘﻣ ﺎﺑ ﺍﺭ ﺮﺻﺎﻨﻋ ﻪﻤﻫ ﺮﯾﺯ ﻝﺎﺜﻣ
ﻪﺟﻮﺗ: ﺪﺷﺎﺑ ﻞﻣﺎﮐ ﻪﻤﻠﮐ ﮏﯾ ﺪﯾﺎﺒﻧ ﺵﺯﺭﺍ!
[class^="top"] {
background: yellow;
}
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<head>
<style>
[class^="top"] {
background: yellow;
}
</style>
</head>
<body>
<h2>CSS [attribute^="value"] Selector</h2>
<h1 class="top-header">Welcome</h1>
<p class="top-text">Hello world!</p>
<p class="topcontent">Are you learning CSS?</p>
</body>
</html>
ﺎﻬﻧﺁ ﯽﮔﮋﯾﻭ ﻪﮐ ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﯼﺮﺻﺎﻨﻋ ﺏﺎﺨﺘﻧﺍ ﯼﺍﺮﺑ [att
ﻪﮐ ﺪﻨﮐ ﯽﻣ ﺏﺎﺨﺘﻧﺍ ﺱﻼﮐ ﻪﺼﺨﺸﻣ ﺭﺍﺪﻘﻣ ﺎﺑ ﺍﺭ ﺮﺻﺎﻨﻋ ﻪﻤﻫ ﺮﯾﺯ ﻝﺎﺜﻣ
ﻪﺟﻮﺗ: ﺪﺷﺎﺑ ﻞﻣﺎﮐ ﻪﻤﻠﮐ ﮏﯾ ﺪﯾﺎﺒﻧ ﺵﺯﺭﺍ!
[class$="test"] {
background: yellow;
}
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<head>
<style>
[class$="test"] {
background: yellow;
}
</style>
</head>
<body>
<h2>CSS [attribute$="value"] Selector</h2>
<div class="first_test">The first div element.</div>
<div class="second">The second div element.</div>
<div class="my-test">The third div element.</div>
<p class="mytest">This is some text in a paragraph.</p>
</body>
</html>
ﺎﻬﻧﺁ ﯽﮔﮋﯾﻭ ﻪﮐ ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﯼﺮﺻﺎﻨﻋ ﺏﺎﺨﺘﻧﺍ ﯼﺍﺮﺑ [att
ﻪﮐ ﺪﻨﮐ ﯽﻣ ﺏﺎﺨﺘﻧﺍ ﺱﻼﮐ ﻪﺼﺨﺸﻣ ﺭﺍﺪﻘﻣ ﺎﺑ ﺍﺭ ﺮﺻﺎﻨﻋ ﻪﻤﻫ ﺮﯾﺯ ﻝﺎﺜﻣ
ﻪﺟﻮﺗ: ﺪﺷﺎﺑ ﻞﻣﺎﮐ ﻪﻤﻠﮐ ﮏﯾ ﺪﯾﺎﺒﻧ ﺵﺯﺭﺍ!
[class*="te"] {
background: yellow;
}
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<head>
<style>
[class*="te"] {
background: yellow;
}
</style>
</head>
<body>
<h2>CSS [attribute*="value"] Selector</h2>
<div class="first_test">The first div element.</div>
<div class="second">The second div element.</div>
<div class="my-test">The third div element.</div>
<p class="mytest">This is some text in a paragraph.</p>
</body>
</html>
:ﺪﻨﺷﺎﺑ ﺪﯿﻔﻣ ﻪﺳﺎﻨﺷ ﺎﯾ ﺱﻼﮐ ﻥﻭﺪﺑ ﯼﺎﻫ ﻡﺮﻓ ﻪﺑ ﻥﺩﺍﺩ ﻞﯾﺎﺘﺳﺍ ﯼﺍﺮﺑ ﺪﻨﻧﺍﻮﺗ ﯽﻣ ﯽﮔﮋﯾﻭ ﯼﺎﻫﺮ
input[type="text"]
{
width: 150px;
display: block;
margin-bottom: 10px;
background-color: yellow;
}
input[type="button"]
{
width: 120px;
margin-left: 35px;
display: block;
}
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<head>
<style>
input[type="text"] {
width: 150px;
display: block;
margin-bottom: 10px;
background-color: yellow;
}
input[type="button"] {
width: 120px;
margin-left: 35px;
display: block;
}
</style>
</head>
<body>
<h2>Styling Forms</h2>
<form name="input" action="" method="get">
Firstname:<input type="text" name="Name" value="Peter" size="20">
Lastname:<input type="text" name="Name" value="Griffin" size="20">
<input type="button" value="Example Button">
</form>
</body>
</html>
ﻪﺘﮑﻧ: ﻝﺎﺜﻣ ﯼﺍﺮﺑﻡﺮﻓ ﻪﺑ ﻥﺩﺍﺩ ﻞﯾﺎﺘﺳﺍ ﻩﻮﺤﻧ ﻩﺭﺎﺑﺭﺩ ﺮﺘﺸﯿﺑ ﯼﺎﻫu
ﻝﺎﺜﻣ
[target]
ﻝﺎﺜﻣ ﺡﺮﺷ
ﺪﻨﮐ ﯽﻣ ﺏﺎﺨﺘﻧﺍ ﺍﺭ ﻑﺪﻫ ﯽﮔﮋﯾﻭ ﺎﺑ ﺮﺻﺎﻨﻋ ﻡﺎﻤﺗ
ﻝﺎﺜﻣ
[target="_blank"]
ﻝﺎﺜﻣ ﺡﺮﺷ
ﺪﻨﮐ ﯽﻣ ﺏﺎﺨﺘﻧﺍ ﺍﺭ "target="_blank ﺎﺑ ﺮﺻﺎﻨﻋ ﻪﻤﻫ
ﻝﺎﺜﻣ
[title~="flower"]
ﻝﺎﺜﻣ ﺡﺮﺷ
.ﺖﺳﺍ "ﻞﮔ" ﺎﻬﻧﺁ ﺯﺍ ﯽﮑﯾ ﻪﮐ ﺖﺳﺍ ﻪﻠﺻﺎﻓ ﺎﺑ ﻩﺪﺷ ﺍﺪﺟ ﺕﺎﻤﻠﮐ ﺯﺍ ﯽﺘﺴﯿﻟ ﯼﻭﺎﺣ ﻪﮐ ﺪﻨﮐ ﯽﻣ ﺏﺎ
ﻝﺎﺜﻣ
[lang|="en"]
ﻝﺎﺜﻣ ﺡﺮﺷ
.ﺪﻨﮐ ﯽﻣ ﺏﺎﺨﺘﻧﺍ ﺍﺭ ﺩﻮﺷ ﯽﻣ ﻉﻭﺮﺷ "en" ﺎﺑ ﻪﮐ lang ﻪﺼﺨﺸﻣ ﺭﺍﺪﻘﻣ ﺎﺑ ﺮﺻﺎﻨﻋ ﻪﻤﻫ
ﻝﺎﺜﻣ
a[href^="https"]
ﻝﺎﺜﻣ ﺡﺮﺷ
.ﺪﻨﮐ ﯽﻣ ﺏﺎﺨﺘﻧﺍ ﺩﻮﺷ ﯽﻣ ﻉﻭﺮﺷ "https" ﺎﺑ ﻪﮐ href ﻪﺼﺨﺸﻣ ﺭﺍﺪﻘﻣ ﺎﺑ ﺍﺭ <a> ﺮﺻﺎﻨﻋ ﻪﻤﻫ
ﻝﺎﺜﻣ
a[href$=".pdf"]
ﻝﺎﺜﻣ ﺡﺮﺷ
.ﺪﻨﮐ ﯽﻣ ﺏﺎﺨﺘﻧﺍ ﺩﻮﺷ ﯽﻣ ﻢﺘﺧ "pdf." ﺎﺑ ﻪﮐ href ﻪﺼﺨﺸﻣ ﺭﺍﺪﻘﻣ ﺎﺑ ﺍﺭ <a> ﺮﺻﺎﻨﻋ ﻪﻤﻫ
ﻝﺎﺜﻣ
a[href*="w3schools"]
ﻝﺎﺜﻣ ﺡﺮﺷ
.ﺪﻨﮐ ﯽﻣ ﺏﺎﺨﺘﻧﺍ "w3schools" ﻪﺘﺷﺭﺮﯾﺯ ﯼﻭﺎﺣ href ﻪﺼﺨﺸﻣ ﺭﺍﺪﻘﻣ ﺎﺑ ﺍﺭ <a> ﺮﺻﺎﻨﻋ ﻪﻤﻫ