Categories

selector

Template-help.com Team September 8, 2015
No votes yet.
Please wait...

CSS elector is the name of each element of your site. With help of selectors you can add CSS rules and style only those elements you want to.

There are plenty of ways to select an element of your site to style it, but the more specific selector is, the better. For example, it’s bad for your site to use generic selectors like .span12, because styles applied for such selector will appear in many places on the site, everywhere where such class is used.

  • Most generic selector is by element. e.g. p or div. CSS rule with them looks like this:

    div { color:#fff; }
  • A little more specific selector is by class, for example .yourcustomclass or .span12 and the rule will look like this:

     .yourcustomclass { color:#fff; }
  • The most specific selector is by elements ID, because IDs are unique, for example #myid. And the rule will look as follows:

     #myid { color:#fff; } 

Each selector type is used for different goals, depending on whether you want to effect one element or numerous with your CSS rule.

Now you know what selector is, thank you for your time.

Bookmarken den permalink.

Submit a ticket

Sollte Ihre Frage durch die Tutorials nicht ausreichend beantwortet worden sein, benutzen Sie bitte den folgenden Link, um sich an unser Beratungsteam (Support) zu wenden. Wir bieten Ihnen unsere Hilfe und Unterstutzung an. 24 Stunden am Tag, 7 Tage die Woche!
Ticket Einrichten

Kommentare sind geschlossen