After installing YCM, no other configurations are added to .vimrc.
Now JavaScript can be automatically completed (for example, if you enter Obj, a popup will automatically appear to let you choose the required completion), but css needs to be completed with omnicomplete by pressing [c-x] [c-o]. How can the css file be used? Autocomplete like JavaScript?
Put this code into your .vimrc and change the number 4 to your indentation setting
Reference link: YCM will not use omnicompletion results in .css files · Issue #413 · Valloric/YouCompleteMe