Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid removing white spaces in CSS files in VS Code?

Having CSS file where the structure is like this:

#something > div {
...
}

When it is saved, it removes the spaces around the child combinator (>) and it makes it look like this:

#something>div {
...
}

Is there a way to avoid this in VS Code?

like image 838
Leo Messi Avatar asked Sep 17 '25 13:09

Leo Messi


1 Answers

I haven't encountered this in VS Code. But I did find this setting in Preferences>Settings that may be the solution.

enter image description here

I do not have it checked and I don't have the same issue you report. Perhaps another setting elsewhere causes it.

like image 114
CChoma Avatar answered Sep 19 '25 05:09

CChoma