-1

I always try to use the single-line approach to declare e.g. the margin of an element.

margin: <margin-top> || <margin-right> || <margin-bottom> || <margin-left>

I was wondering if this actually runs faster than the four-line approach.

margin-top: <margin-top>;
margin-right: <margin-right>
margin-botttom: <margin-bottom>
margin-left: <margin-left>
Farhad
  • 4,119
  • 8
  • 43
  • 66
Dirk Swaapt
  • 17
  • 1
  • 4
  • 2
    All browsers are not created equally, but this probably doesn't matter at all. You should write the code that you find most readable first, and worry about performance if you actually perceive a performance issue. – Bill the Lizard Aug 02 '17 at 12:15
  • 1
    This is somewhat akin to asking what type of sandals you should wear to get the best acceleration from putting your foot down on the pedal in your FORD C-MAX – Martin Aug 02 '17 at 12:17

1 Answers1

3

you can use shorthand property

Ex: margin: top right bottom left;
In place of top,right,bottom,left you will give values.
Barkermn01
  • 6,781
  • 33
  • 83
Mehraj Khan
  • 927
  • 6
  • 17