0

Starting my css with:

* {
 margin:0 auto;
padding:0;
}

this does not work anymore.

background:linear-gradient(90deg, red, blue);

I did not so much webdesign the last couple of years, but as i figured out, resetting margin and padding is still necessary. What do I have to code for linear Background instead?

  • Please don't do `* { margin: 0 auto; }` as that will seriously mess-up your page's layout (as `auto` horizontal margins have their own complicated behaviour). Generally speaking, you don't need to "reset" CSS with a catch-all `*` rule anyway. – Dai Feb 23 '22 at 07:59
  • "resetting margin and padding is still necessary" - no, it isn't. A margin/padding reset rule is more akin treating the symptoms, rather than addressing the root cause. So if you are finding that adding a `*` rule somehow is necessary then that actually means you have problems elsewhere in your stylesheets: so please post an example stylesheet where you're doing that then we can help you with your underlying problem. – Dai Feb 23 '22 at 08:03

0 Answers0