skip to Main Content

I recently came to know about box-sizing border box property .I think we can add this property in universal selector in css .So that it will apply to each and every element

.My question is .is it necessary to add this property in every project?

i tried to add box-sizing property in universal selector . and it worked.Need advice if i should use it in every project

2

Answers


  1. Personally I don’t believe in using CSS resets, especially with the universal selector. I think the risk is too high that they will interfere with browser default behaviour, especially on widgets like date pickers. I prefer to just set box-sizing: border-box; on any element where it is necessary.

    Login or Signup to reply.
  2. You can use *{box-sizing: border-box;}. It would be best practice for any project because If you set box-sizing: border-box; on an element, padding and border are included in the width and height.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search