شما اینجا هستید

انتخابگرها برای انتخاب و دستکاری کردن عناصر HTML بکار میروند.

انتخابگرها به ما این امکان را میدهند که بر اساس شناسه (id), کلاس, نوع, خصوصیت و چیزهای دیگر عناصر HTML را پیدا یا (انتخاب) کنیم.

سلکتور عنصر

سلکتور عنصر, عناصر را براساس نام عنصر انتخاب میکند. شما میتوانید همه عناصر <p> را مانند مثال زیر انتخاب کنید:

<html>

<head>

<style>

p {

text-align: center;

color: red;

}

</style>

</head>

<body>



<p>Every paragraph will be affected by the style.</p>

<p id="para1">Me too!</p>

<p>And me!</p>



</body>

</html>

 

سلکتور id

 

سلکتور id برای انتخاب یک عنصر به خصوص با استفاده از خصوصیت id یک عنصر HTML بکار میرود.

یک شناسه باید در یک صفحه منحصر به فرد باشد و تکراری نباشد و فقط برای یک عنصر خاص بکار رود. بنابراین اگر میخواهید یک عنصر خاص را انتخاب کنید از انتخابگر شناسه استفاده میکنید.

برای انتخاب یک عنصر با استفاده از شناسه، باید قبل از شناسه یک علامت # بنویسیم.

در مثال زیر برای عنصر با "id="para1 کد css مینویسیم:

<html>

<head>

<style>

#para1 {

text-align: center;

color: red;

}

</style>

</head>

<body>



<p id="para1">Hello World!</p>

<p>This paragraph is not affected by the style.</p>



</body>

</html>

 

نام شناسه را با عدد شروع نکنید!

 

سلکتور کلاس

انتخابگر کلاس، عناصری را که با یک کلاس مشخص شده اند را انتخاب میکند. برای انتخاب عناصر با یک کلاس مشخص باید قبل از نام خصوصیت کلاس یک نقطه به این صورت classname. بنویسید.

در مثال زیر همه عناصر HTML با "class="center وسط چین میشوند:

<html>

<head>

<style>

.center {

text-align: center;

color: red;

}

</style>

</head>

<body>



<h1 class="center">Red and center-aligned heading</h1>

<p class="center">Red and center-aligned paragraph.</p>



</body>

</html>

 

شما همچنین میتوانید یک عنصر خاص را با این کلاس برایش css بنویسید.

در مثال زیر همه عناصر <p> با کلاس center وسط چین میشوند و بقیه عناصر با همین کلاس تغییری نمیکنند.

<html>

<head>

<style>

p.center {

text-align: center;

color: red;

}

</style>

</head>

<body>



<h1 class="center">This heading will not be affected</h1>

<p class="center">This paragraph will be red and center-aligned.</p>



</body>

</html>

 

نام کلاس را با عدد شروع نکنید!

 

انتخابگرهای گروهی

اگر عناصر دارید که تعریف استایل آنها مانند نمونه زیر مشابه هم است، میتوانید همه آنها را در یک گروه بنویسید و اینکار باعث میشود که حجم کدهای شما کم شود.

h1 {
    text-align: center;
    color: red;
}

h2 {
    text-align: center;
    color: red;
}

p {
    text-align: center;
    color: red;
}

برای هم گروه کردن سلکتورها، هر سلکتور را با یک کاما جدا میکنیم.

درمثال زیر ما کد بالا را به صورت سلکتورهای هم گروه شده درآوردیم:

h1,h2,p {
    text-align: center;
    color: red;
}

 

دیدگاه‌ها

quick way to pay student loans quick cash loans scam quick loan fast quick loans quick loans rates

quick pay payday loans quick & easy personal loans quick loans quick loan home loans quick loans payment center

quick loans 100% approval personal loans quick quick loan quick cash loans huntsville al quick safe loans

quick personal loans online quick business loans for startups quick loans quick and easy business loans quick business loans for startups

https://paydailoanz.com/# - quick loan

make money apps how does craigslist make money work from home how did betsy devos make her money how much money do youtubers make

how to make money at home how to make more money work from home make money online from home how did jerry jones make his money

https://make-money-blogs.com/# - make money

how to make money with youtube best ways to make money work from home how to make money quick how does robinhood make money

how to make quick money how to make more money make money make money on the side how to make money at home

https://make-money-blogs.com/# - make money

make money from home make money on youtube work from home how to make money on instagram make money on youtube

how to make money on instagram make money online make money easy way to make money make extra money from home

https://make-money-blogs.com/# - make money

make extra money how did mark cuban make his money work from home how to make money online fast hobbies that make money

ways to make money online easy ways to make money work from home how to make money on facebook how did jeffrey epstein make his money

http://getrockmusic.ru/ - make money

how to make fast money online hobbies that make money work from home make money on facebook how to make money from home

how to make money selling drugs how do you make money on youtube make money how to make quick money how to make money on instagram

http://tvorec-ed.ru/ - make money

how to make money on the side ways to make money make money easy way to make money where did nancy pelosi make her money

how to make money with a website money make make money money make make money now

https://bererigip.ru/ - make money

how to make money on twitch photos imgclick easily make money sharing will friends social free file upload make money how to make money without a job diy crafts that make money

make money online surveys free ways to make money online make money how to make money blogging how to make money on facebook

https://digenahead.ru/ - work from home

how to make money online from home how to make money fast make money woodworking ideas to make money make money blogging

how does robinhood make money how to make money on youtube videos work from home make money fast ways to make money fast

http://exchangevisits.ru/ - work from home

dog bounty hunter wife weight loss aretha franklin weight loss weight loss loose skin after weight loss susan boyle weight loss

saxenda for weight loss activated charcoal lemonade weight loss weight loss honey boo boo weight loss honey boo boo weight loss

https://weight-loss-blogs.com/# - weight loss

how does robinhood make money make money online make money how to make extra money how does facebook make money

make money online from home how to make quick money make money how did betsy devos make her money make money at home

https://www.fresher.ru/elz/# - make money

easy ways to make money online how to start a blog and make money make money online make money taking surveys how did mark cuban make his money

imgclick will easily make money sharing photos friends social free file upload how to make easy money [url=https://make-money-blogs.com/# ] make money online[/url] legit ways to make money online make money online from home

https://make-money-blogs.com/# - make money

http://www.radioveronicaone.it/2019/08/26/avv-cerciello-rega-venerdi-ana...
https://uu-cafe.ru/product/lanch-boks/goryachiy-kompleksnyy-obed-fasol-s...
https://blog.leithacuracary.com/personalized-mothers-day-gift-ideas/moth...
https://www.huaral.pe/simulacro-escolar-huaral/2018/?unapproved=156176&m...
https://naijasurf.com.ng/2019/05/04/another-nigerian-stabbed-to-death-in...

online poker real money how to work from home sykes work at home real work from home jobs walmart money transfer online

make extra money from home how to make more money [url=https://make-money-blogs.com/# ] make money online free[/url] how to make money at home work from home

https://make-money-blogs.com/# - best way to make money online

ways to make money how to make more money best way to make money online online casino real money how much money do youtubers make

how to make money make money online free [url=https://make-money-blogs.com/# ] money online[/url] making money from home best ways to make money online

https://make-money-blogs.com/# - make extra money

how to make extra money from home how to make money on youtube legitimate work from home jobs make money blogging how to work from home

western union online send money home work [url=https://make-money-blogs.com/# ] walmart to walmart money transfer online[/url] work at home jobs legitimate work from home opportunities

https://make-money-blogs.com/# - passive income opportunities

best work from home jobs how to make money from home online surveys for money making money from home passive income online

passive income online surveys for money [url=https://make-money-blogs.com/# ] money online[/url] how much money does pewdiepie make work from home companies

https://make-money-blogs.com/# - runescape money making

online surveys for money money online how to make money online fast work from home jobs legitimate work from home companies

free money online send money online [url=https://make-money-blogs.com/# ] online money[/url] make extra money from home free money online

https://make-money-blogs.com/# - passive income streams

buy coronavirus coronavirus cat coronavirus genome buy coronavirus coronavirus dog

is coronavirus contagious equine coronavirus [url=https://pharm-usa-official.com/coronavirus/# ] coronavirus genome[/url] coronavirus pneumonia feline coronavirus test

https://pharm-usa-official.com/coronavirus/# - hku1 coronavirus

m.e.r.s coronavirus coronavirus pneumonia fip coronavirus canine enteric coronavirus dog coronavirus

symptoms of coronavirus in cats middle east respiratory syndrome coronavirus [url=https://pharm-usa-official.com/coronavirus/# ] dog coronavirus[/url] cat tested positive for coronavirus coronavirus treatment

https://pharm-usa-official.com/coronavirus/# - what is mers coronavirus

amazon work from home how to make more money walmart money transfer online how to make money blogging make extra money from home

makw money online ways to make money from home [url=https://make-money-blogs.com/# ] make money online from home[/url] how to make money online legitimate work from home jobs

https://make-money-blogs.com/# - make money online fast

how to make more money how to make money online fast make extra money make extra money passive income online

make money online free work from home jobs legitimate [url=https://make-money-blogs.com/# ] free money online[/url] ways to make money from home how to make money

https://make-money-blogs.com/# - how to make passive income

generic cialis online

[url=https://wowcialisnow.com/# ] cialis buy cialis online[/url]

https://wowcialisnow.com/# - cialis generic

cialis online

[url=https://wowcialisnow.com/# ] cialis 20mg[/url]

https://wowcialisnow.com/# - cialis cialis

melissa mccarthy weight loss safflower oil for weight loss weight loss weight loss motivation safflower oil for weight loss

kirsten vangsness weight loss best weight loss diet [url=https://weight-loss-blogs.com/# ] intermittent fasting weight loss[/url] metformin weight loss red mountain weight loss

https://weight-loss-blogs.com/# - medi weight loss

cialis online

[url=https://wowcialisnow.com/# ] cialis cialis[/url]

https://wowcialisnow.com/# - cialis generic

weight loss drugs weight loss foods apple cider vinegar for weight loss keely shaye smith weight loss loose skin after weight loss

keto weight loss essential oils for weight loss [url=https://weight-loss-blogs.com/# ] medical weight loss[/url] hypnosis for weight loss weight loss smoothie recipes

https://weight-loss-blogs.com/# - calorie calculator for weight loss

jorge garcia weight loss yoga for weight loss weight loss diet rebel wilson weight loss best weight loss pills 2019

safflower oil for weight loss wellbutrin weight loss [url=https://weight-loss-blogs.com/# ] best weight loss pill[/url] kelly clarkson weight loss 2018 loose skin after weight loss

https://weight-loss-blogs.com/# - weight loss

generic cialis

[url=https://wowcialisnow.com/# ] generic cialis tadalafil[/url]

https://wowcialisnow.com/# - cialis generic

nathan fillion weight loss weight loss motivation weight loss meal plan saxenda for weight loss best weight loss pills

weight loss surgery wellbutrin weight loss [url=https://weight-loss-blogs.com/# ] calorie calculator for weight loss[/url] red mountain weight loss apple cider vinegar weight loss

https://weight-loss-blogs.com/# - best weight loss diet

cialis generic

[url=https://wowcialisnow.com/# ] cialis cialis generic[/url]

https://wowcialisnow.com/# - cialis generic cialis

cialis cialis

[url=https://wowcialisnow.com/# ] cialis cialis generic[/url]

https://wowcialisnow.com/# - online cialis

aretha franklin weight loss weight loss rebel wilson weight loss apple cider vinegar weight loss drink weight loss shakes

weight loss surgery weight loss plan [url=https://weight-loss-blogs.com/# ] best diet for weight loss[/url] essential oils for weight loss honey boo boo weight loss

https://weight-loss-blogs.com/# - before and after weight loss

best protein powder for weight loss sota weight loss weight loss clinic weight loss clinic metformin weight loss

keely shaye smith weight loss best weight loss diet [url=https://weight-loss-blogs.com/# ] intermittent fasting weight loss[/url] weight loss coffee golo weight loss

https://weight-loss-blogs.com/# - calorie calculator for weight loss

cialis online

[url=https://wowcialisnow.com/# ] buy cialis online[/url]

https://wowcialisnow.com/# - generic cialis tadalafil

cialis cialis

[url=https://wowcialisnow.com/# ] cialis generic[/url]

https://wowcialisnow.com/# - generic cialis 20mg

cialis generic cialis

[url=https://wowcialisnow.com/# ] cialis cialis generic[/url]

https://wowcialisnow.com/# - cialis online

kelly clarkson weight loss weight loss smoothie recipes meal plan for weight loss weight loss blogs gabourey sidibe weight loss before and after

meal plan for weight loss celine dion weight loss [url=https://weight-loss-blogs.com/# ] weight loss calculator[/url] weight loss coffee before and after weight loss

https://weight-loss-blogs.com/# - weight loss pills

rapid weight loss healthy recipes for weight loss chrissy metz weight loss sota weight loss healthy recipes for weight loss

weight loss supplements weight loss plateau [url=https://weight-loss-blogs.com/# ] weight loss pills[/url] weight loss clinics near me honey boo boo weight loss

https://weight-loss-blogs.com/# - weight loss meal plans

best diet for weight loss best weight loss pills weight loss supplements shark tank weight loss drink ariel winter weight loss

weight loss clinics near me sara rue weight loss [url=https://weight-loss-blogs.com/# ] best weight loss diet[/url] lemon and cucumber water for weight loss precious weight loss

https://weight-loss-blogs.com/# - medi weight loss

صفحه‌ها

افزودن دیدگاه جدید

دیدگاه

  • تگ‌های HTML مجاز: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • خطوط و پاراگراف‌ها بطور خودکار اعمال می‌شوند.
  • نشانی صفحه‌ها وب و پست الکترونیک بصورت خودکار به پیوند تبدیل می‌شوند.

Plain text

  • تگ‌های HTML مجاز نیستند.
  • نشانی صفحه‌ها وب و پست الکترونیک بصورت خودکار به پیوند تبدیل می‌شوند.
  • خطوط و پاراگراف‌ها بطور خودکار اعمال می‌شوند.
كد امنيتي
این پرسش برای جلوگیری از ارسال اسپمهای اتوماتیک است.