CSS ﯼﺎﻫ ﻩﺪﻧﺭﺎﻤﺷ


فهرست مطالب

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


Pizza

Hamburger

Hotdogs

.ﺪﯿﻨﮐ ﻢﯿﻈﻨﺗ ﺪﻨﺳ ﺭﺩ ﻥﺁ ﯼﺮﯿﮔﺭﺍﺮﻗ ﺱﺎﺳﺍ ﺮﺑ ﺍﺭ ﺍﻮﺘﺤﻣ ﺮﻫﺎﻇ ﺪﻨﻫﺩ ﯽﻣ ﻥﺎﮑﻣﺍ ﺎﻤﺷ ﻪﺑ ﺎﻫ ﻩ


ﻩﺪﻧﺭﺎﻤﺷ ﺎﺑ ﺭﺎﮐﺩﻮﺧ ﯼﺭﺍﺬﮔ ﻩﺭﺎﻤﺷ

.ﺩﺍﺩ ﺶﯾﺍﺰﻓﺍ (ﺪﻨﮐ ﯽﻣ ﯽﺑﺎﯾﺩﺭ ﺍﺭ ﺎﻬﻧﺁ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺕﺎﻌﻓﺩ ﺩﺍﺪﻌﺗ ﻪﮐ) CSS ﻦﯿﻧﺍﻮﻗ ﺎﺑ ﻥﺍ

:ﻢﯿﻨﮐ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﺮﯾﺯ ﯼﺎﻫ ﯽﮔﮋﯾﻭ ﺯﺍ CSS ﯼﺎﻫ ﻩﺪﻧﺭﺎﻤﺷ ﺎﺑ ﺭﺎﮐ ﯼﺍﺮﺑ

counter-reset

ﺪﻨﮐ ﯽﻣ ﺩﺪﺠﻣ ﻢﯿﻈﻨﺗ ﺎﯾ ﺩﺎﺠﯾﺍ ﻩﺪﻧﺭﺎﻤﺷ ﮏﯾ -

counter-increment

ﺪﻫﺩ ﯽﻣ ﺶﯾﺍﺰﻓﺍ ﺍﺭ ﻩﺪﻧﺭﺎﻤﺷ ﺭﺍﺪﻘﻣ ﮏﯾ -

content

ﺪﻨﮐ ﯽﻣ ﺝﺭﺩ ﺍﺭ ﻩﺪﺷ ﺪﯿﻟﻮﺗ ﯼﺍﻮﺘﺤﻣ -

counter() or counters() function

ﺪﻨﮐ ﯽﻣ ﻪﻓﺎﺿﺍ ﺮﺼﻨﻋ ﮏﯾ ﻪﺑ ﺍﺭ ﻩﺪﻧﺭﺎﻤﺷ ﺭﺍﺪﻘﻣ -

.ﺩﻮﺷ ﺩﺎﺠﯾﺍ counter-reset ﺎﺑ ﺪﯾﺎﺑ ﺍﺪﺘﺑﺍ ،CSS ﻩ

.ﺪﻨﮐ ﯽﻣ ﺩﺎﺠﯾﺍ (ﻪﻧﺪﺑ ﺮﮕﺑﺎﺨﺘﻧﺍ ﺭﺩ) ﻪﺤﻔﺻ ﯼﺍﺮﺑ ﻩﺪﻧﺭﺎﻤﺷ ﮏﯾ ﺮﯾﺯ ﻝﺎﺜﻣ

ﻝﺎﺜﻣ

body {
  counter-reset: section;
}
h2::before {
  counter-increment: section;
  content: "Section " counter(section) ": ";
}

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

<!DOCTYPE html>
<html>
<head>
<style>
body {
  counter-reset: section;
}

h2::before {
  counter-increment: section;
  content: "Section " counter(section) ": ";
}
</style>
</head>
<body>

<h1>Using CSS Counters</h1>

<h2>HTML Tutorial</h2>
<h2>CSS Tutorial</h2>
<h2>JavaScript Tutorial</h2>
<h2>Python Tutorial</h2>
<h2>SQL Tutorial</h2>

</body>
</html>




ﻮﺗﺭﺩﻮﺗ ﯼﺎﻫ ﻩﺪﻧﺭﺎﻤﺷ

:"ﯽﻋﺮﻓ ﺶﺨﺑ ﻩﺪﻧﺭﺎﻤﺷ ﺭﺍﺪﻘﻣ.ﺶﺨﺑ ﻩﺪﻧﺭﺎﻤﺷ ﺭﺍﺪﻘﻣ

ﻝﺎﺜﻣ

body {
  counter-reset: section;
}
h1 {
  
counter-reset: subsection;
}
h1::before {
  counter-increment: 
section;
  content: "Section " counter(section) ". ";
}
h2::before {
  
counter-increment: subsection;
  content: 
counter(section) "." counter(subsection) " ";
} 

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

<!DOCTYPE html>
<html>
<head>
<style>
body {
  counter-reset: section;
}

h1 {
  counter-reset: subsection;
}

h1::before {
  counter-increment: section;
  content: "Section " counter(section) ". ";
}

h2::before {
  counter-increment: subsection;
  content: counter(section) "." counter(subsection) " ";
}
</style>
</head>
<body>


<h1>HTML/CSS Tutorials</h1>
<h2>HTML</h2>
<h2>CSS</h2>
<h2>Bootstrap</h2>
<h2>W3.CSS</h2>

<h1>Scripting Tutorials</h1>
<h2>JavaScript</h2>
<h2>jQuery</h2>
<h2>React</h2>

<h1>Programming Tutorials</h1>
<h2>Python</h2>
<h2>Java</h2>
<h2>C++</h2>

</body>
</html>


ﺖﺳﺍ ﺪﯾﺪﺟ ﺖﺴﯿﻟ ﮏﯾ ﺍﺮﯾﺯ ﺪﺷﺎﺑ ﺪﯿﻔﻣ ﻩﺪﺷ ﺺﺨﺸﻣ ﯼﺎﻫ ﺖﺴﯿﻟ ﺩﺎﺠﯾﺍ ﯼﺍﺮﺑ ﺪﻧﺍﻮﺗ ﯽﻣ ﻦﯿﻨﭽﻤﻫ ﻩ

ﻝﺎﺜﻣ

ol {
  counter-reset: section;
  
list-style-type: none;
}

li::before {
  counter-increment: section;
  
content: counters(section,".") " ";
} 

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

<!DOCTYPE html>
<html>
<head>
<style>
ol {
  counter-reset: section;
  list-style-type: none;
}

li::before {
  counter-increment: section;
  content: counters(section,".") " ";
}
</style>
</head>
<body>

<ol>
  <li>item</li>
  <li>item   
  <ol>
    <li>item</li>
    <li>item</li>
    <li>item
    <ol>
      <li>item</li>
      <li>item</li>
      <li>item</li>
    </ol>
    </li>
    <li>item</li>
  </ol>
  </li>
  <li>item</li>
  <li>item</li>
</ol>

<ol>
  <li>item</li>
  <li>item</li>
</ol>

</body>
</html>



CSS ﻩﺪﻧﺭﺎﻤﺷ ﯼﺎﻫ ﯽﮔﮋﯾﻭ

content

.ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ after:: ﻭ before:: ﻪﺒﺷ ﺮﺻﺎﻨﻋ ﺎﺑ ﻩﺪﺷ ﺪﯿﻟﻮﺗ ﯼﺍﻮﺘﺤﻣ ﺝﺭﺩ ﯼﺍﺮﺑ

counter-increment

ﺪﻫﺩ ﯽﻣ ﺶﯾﺍﺰﻓﺍ ﺍﺭ ﻩﺪﻧﺭﺎﻤﺷ ﺭﺍﺪﻘﻣ ﺪﻨﭼ ﺎﯾ ﮏﯾ

counter-reset

ﺪﻨﮐ ﯽﻣ ﯽﻧﺎﺸﻧﺯﺎﺑ ﺎﯾ ﺩﺎﺠﯾﺍ ﺍﺭ ﻩﺪﻧﺭﺎﻤﺷ ﺪﻨﭼ ﺎﯾ ﮏﯾ

counter()

ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﺍﺭ ﻩﺪﺷ ﯼﺭﺍﺬﮕﻣﺎﻧ ﻩﺪﻧﺭﺎﻤﺷ ﯽﻠﻌﻓ ﺭﺍﺪﻘﻣ

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