CSS style tag


#1

Why does the style tag need to be formatted like this:
p {
color: red;
font-size: 20px;
}

Is it still proper to write it like this: p {color:red; font-size: 20px;} ?


#2

its less readable. What you see a lot these days is to write:

p {
  color: red;
  font-size: 20px;
}

and then for production minify the css file (there are tools for this), which remove all the spaces and white lines. This way you have the smallest file for production (to serve to clients) and a readable version to maintain


#3

Yes it is, but whitespace makes for easier reading.