Nesting

Nesting rules:

  • do not use IDs in nesting; use classes instead; more than one same ID makes page not valid and it is hard to select few similar elements with css or javascript; (bad: #title; good: .title)
  • do not use !important;
  • do not use tags in nesting; use only classes; it is easier to change tags in template later; (bad: div.title; good: .title - because div.title could be changed to section.title in future)
  • do not use "_" (underscore) in classes; use "-" (hyphen) instead; (bad: .main_title; good: .main-title)
  • a heading should not become a heading in another part of the page;
  • class names should be abstract; what is red today could be blue in future; (bad: .red-block; good: .news-block;)

Nesting links:

VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">