Create pure simple HTML / CSS using best practices

It's hard for me to create clean, supported HTML / CSS code. Is there an editor, book or webpage that can help me using best practices.

Here are some examples:

  • Naming sections and classes: you may have an area with a user profile. What would you call id and classes? (# author_profile, .username, .userBirthday, etc.)

  • Tags or div: I get confused many times when you need to create your own divs or use a tag with id / class. Any good examples?

  • Positioning: in 99% of cases I set the fixed width of the elements and used float: left / right. Any tips for creating CSS positioning are more accessible. I tried a lot of CSS frameworks, but this did not work for me. It always ends with deeply nested divs and lots of classes.

+5
source share
3 answers
+3
source
+5
source

You can also use this chrome plugin called CSS Brush to test it live on a web page. A context-sensitive menu helps you see that all properties exist for a particular style and apply to the live element. After you have completed all the CSS, you can copy them all and paste them into your CSS file.

-1
source

All Articles