Mentioning the HTML TAG element before a CLASS or ID (Good or unnecesary CSS practice?) -


Actually, I want to know what is best to avoid future problems and confusions with CSS code. ..

Naming the species of CSS like this:

  div # content ul # navigation div.float-left  

( Is it really unnecessary?)

Or just

  #content #navigation .float-left  

There is no experience so I want someone to tell me that HTML and CSS Which method is better for long-term use.

Thank you in advance!

It depends on what you want to do.

  #content  

will apply to everything with id = "content", but

  div # content  

only a & lt; Div & gt; With id = "content"

Usually this is a problem with sections because all elements on an ID should be unique.

Know the style information will apply to only a certain type of HTML elements, then include the element tag, by applying these elements in the same category (or with IDs, unexpectedly apply to different elements Can stop, but it's naughty).


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -