I'm new on this site, and I don't even know if I'm posting on the right section but here we go.
I'm writing a simple HTML file with a CSS attached, in the HTML, I have a piece of code that is like this:
<ul id="thing_list">
<li>
<div>
<header>
<h2>Name of the thing</h2>
<p>Some thing here</p>
</header>
<nav>
<ul id="actions">
<li>Edit</li>
<li>Move</li>
<li>Delete</li>
</ul>
<nav>
</div>
</li>
And the CSS for this is like:
#thing_list li > div > nav li {
list-style-type: none;
display: inline;
vertical-align: bottom;
}
#actions li {
position: absolute;
bottom: 0;
}
So, the question is, which way is better for me to name things? Is is better to define an ID/Class for everything or to define a few and use #thing_list li > div > nav li?
I'm not so sure if you guys can understand, english is not my main language, so please bear with me on that.
id's must be unique, hence the name id. Aclassattribute can be attached to multiple elements. Classes are a way of grouping similar elements, e.g a<li class='nav-list' id='home'>Home</li> <li class='nav-list' id='about'>About Me</li>>in your CSS. do you understand it.#thing_list li > div > nav libecause it will take more time to Browser read this full syntax.