0
CSS code
Hello hello!!! i have just learn the css code and i would like to know the chronology when i'm coding if i want a clean website (i mean with which class or id i have code first then after). Is there someone who can help me with that? Is there any courses i can find for that? ps: Excuse my english!!! :/ thank you :)
4 Answers
+ 5
first use the smantic tags like <header> <footer> <section>
then use the id for specific part of your page
like <section id="slider">....or <section id="latest news" ....so on
then use the class names for define the style meaning not meaning of content like <div class="card"> ..... </div> or <div class="box">.... not <div class=red-text> or class="section-one"
+ 1
It does not matter what order things are done. I put my tag based styles first, following by the class based ones, ending with my id based ones. If there are a lot of them, I'd list those sections in alphabetical order.
+ 1
ok i'll follow your advice , thank you @john Wells for your answer
+ 1
thank you @Mukhtaar
that will help, i'm always doing that mistake like <div class=red-text>