Hello and thank you for taking your time to read my question. My question pertains to html best practices.
I have a html skeleton that looks like this..
<!DOCTYPE html>
<html lang="en">
<head>
<title>Template</title>
<meta charset="utf-8">
</head>
<body>
<header>
</header>
<main>
</main>
<footer>
</footer>
</body>
</html>
and I want to start adding HTML elements that I will later select these elements by ID and CLASS within CSS and JavaScript. My "Best Practice" related questions are..
- Do ID and CLASS have identical naming conventions?
- What is the minimum and maximum recommended ID and CLASS attribute length?
- Why do websites like facebook name there ID and CLASS atributes with random numbers and letters?
- Should I use camelcase?
- Should I use underscores or numbers?
- Should I shorten words with abbreviates like "Detail" becomes "Det" when naming?
- Should I give ever elements that is a child of body a ID and CLASS atribute?
- Would I ever need to specify an ID or CLASS attribute for a element within the HEAD element?