'property: 0' or 'property: 0px' in CSS?

后端 未结 9 1729
无人及你
无人及你 2020-11-28 10:38

I\'ve seen this notation used a lot, and I was wondering, is there is any notable difference between these two notations?

element#id
{
  property: 0;
}
         


        
9条回答
  •  孤独总比滥情好
    2020-11-28 10:54

    I personally find 0 cleaner than 0px. That's two extra characters that can add up. Why add extra bytes when you don't need to. I have see padding: 0px 0px 0px 0px which can easily be expressed as padding: 0 way too often.

提交回复
热议问题