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.

Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket

Comments are closed.