CSS / HTML naming and calling elements

I am new to this site and I don’t even know if I am posting in the right section, but here we go.

I am writing a simple HTML file with CSS attached, in HTML, I have a piece of code that looks 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 CSS for this:

#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, how do I name things better? Is it best to define an ID / Class for everything or define a few and use #thing_list li> div> nav li?

I'm not sure you guys can understand English is not my main language, so please bear with me.

+4
source share
2 answers

CSS- CSS- , CSS , CSS . CSS CSS , CSS. CSS , , , . , CSS, -. #thing_list li > div > nav li , . , !

+2

-, HTML (, , dl/dt/dd ).

. css - "", . .

: - URL-.

: , , :

 <label>Name: <input></label>
 <label>Saluation: <input class="sal" ></label>

 <style>
 input{
     background-color:blue;
 }
 input.sal{ 
     background-color:red;
 }
 </style>

. , .

, .

0

All Articles