0
remove unwanted spaces
when we use internal css(embedding the style rules inside <style>), we have 4-8 or another amount of space indentations to show it being nested inside <style>, which is nested inside <head>. but when we want to move the css to a seperate file(external css), these spaces/indentations remain there. it looked fine in the internal css code, as it was nested inside other tags. but when moved into a seperate css file with no parent to nest it, it looks bad with the weird spaces before each line. how can we remove it? there are online tools to do it, but i was looking for a straightforward approach i can take directly in my editor.
1 Antwort
+ 1
well it depends on the editor, so you'll have to look that up. Some have a "prettifier" plugin that can adjust things for you.
There isn't a universal way to do it like ctrl+v is assumed to be known for all editors
Tips:
- only use spaces (no tabs). Some editors allow for replacing tabs with spaces
- After pasting, use tab or shift tab to adjust your code
- See if your editor allows for some kind of "prettifier" plugin so all you need to do is save the document and everything else is adjusted for you
- Don't get used to using the style tag. It's best to keep your styles on a separate file anyway. For one or two little things, or for a prototype it's fine to use the style tag, but bad to use it all the time