-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; rgiht側では機能しません。親の amp-element が display: inline-block; の原因だと思います。

それを修正する方法は?

ありがとう!

4

1 に答える 1

1

パディングが要素のサイズに追加されるだけなので、要素がオーバーフローします。幅/高さからパディングを差し引くか、box-sizing:border-box上記の要素に追加する必要があります。

MDN のパディング

MDN のボックスサイズ

于 2016-03-18T08:27:09.047 に答える