Negative Margins, Hack or Not?

后端 未结 3 822
不知归路
不知归路 2021-02-18 17:18

I\'ve come across various posts where people are stating that negative margins are hacks. Thus I\'ve strayed away from using them with exception to particular cases when I can j

3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-18 17:52

    I would argue it's not a hack: It's defined, logical behaviour; it's supported in all browsers; it can be expected to be supported in future versions of browsers (the absence of future support is the most important argument against hacks).

    Also, as @durilai points out, they are officially sanctioned (although with limits) by the W3C.

    This Smashing Magazine article supports the case.

提交回复
热议问题