While clearing through the criteria on freeCodeCamp, along with reading other posts online, it has become apparent to me that writing out your code a certain way is important to coders and employers alike. I’m currently going through the Basic CSS section where is laid out as:
<style>
.red-text {
color: red;
}
I wrote it out as .red-text {color: red;} and obviously the section cleared, but on the next section the code went back to the way it is above.
Is this the correct etiquette? Does it matter either way?
I started freeCodeCamp about two days ago and I’m finding myself waking up everyday jumping on and hashing a little bit out before starting my day. Loving it so far.
You’ll generally find that most professional codebases or public projects you work on will likely have linters that apply particular style preferences to the project.
If you are interested in learning best CSS coding conventions, you can read about OOCSS, and BEM CSS.
These are a couple of technique in writing CSS. If you have some experience with CSS coding, you can understand them quickly because it is a solution for many problem we face a web designer.
There are many articles on the web. You can also check YouTube. You cab search for “OOCSS” in Google or YouTube.