0
Question in CSS
Do you really need to indent in CSS?
8 Answers
+ 4
Short answer:
No.
Long answer:
Indentation is good practice and is used purely to write clear code. Code will look nicer and is much easier to work with.
However it is also good practice to remove indentation and comments etc in your code when used online with a website. This proces is called minifying/compressing, it will automatically remove indentation and comments for you.
So use identation and minify when deploying online.
Common practice:
style.css <- your file with identation
style.min.css <- minified code for website
There are enough extensions for VS Code that will do it automatically for you, and you also have enough online free minifying websites.
It also applies to javascript.
+ 6
You dont have to, but it is much easier to work with indented code.
Thats why this is good practice.
+ 3
AJ šŗš¦#PeaceForUkrainešŗš¦
Did you write without indent? Did you get any problem? CSS/Html never give any error do you know?
+ 3
AJ šŗš¦#PeaceForUkrainešŗš¦
Indentation is always good for any language but only few languages compalsary needs indent like python.
Html and CSS never gives any error so doesn't matter how you write code.
+ 2
No we don't need indentation in css but we use indentation to make our code look much good, clean and clear.
+ 1
AĶ¢J I didnāt write without indent, I was just curious.
0
No you dont need to
0
AĶ¢J Ah, okay.