-1

尝试设置 amp-user-notification 但填充不起作用。填充权

  amp-user-notification {
      min-height: 30px;
      font-family: 'Roboto';
      font-weight: 500;
      line-height: 30px;
      padding: 8px;
      background: #46b6ac;
    }

https://github.com/ampproject/amphtml/blob/master/examples/user-notification.amp.html

填充:8px;确实适用于右侧。我认为原因父 amp-element 是 display: inline-block;

如何解决?

谢谢!

4

1 回答 1

1

It works just fine, it is just that the padding adds to the element's size, so the element overflows. You have to either subtract your padding from your width/height, either add box-sizing:border-box to said element.

padding in MDN

box-sizing in MDN

于 2016-03-18T08:27:09.047 回答