簡體   English   中英

CSS & Safari (iOS) - 溢出

[英]CSS & Safari (iOS) - overflow y

由於 iOS 14,具有“溢出-y:滾動”屬性的 div 中的內容似乎不適用於 Safari,有人有解決方案嗎? (也許只是我的代碼也不起作用。)

我不知道為什么它現在這樣做,我的手機上沒有調試工具(悲傷......)但它在 iOS 13.6 下工作。

我在下面舉了一個例子。

<html lang="fr">
  <style>
    html{
        background-color: var(--background);
        z-index: -9999;
    }

    body{
        position: relative;
        width: 100%;
        top: 0;
        left: 0;
        right: 0;
        margin: 0;
        z-index: -9999;
    }
    .head{
      position: relative;
      display: block;
      top: 0;
      left: 0;
      right: 0;
      height: 10vh;
      background-color: blue;
      border-radius: 8px;
    }
    .emb-content{
      margin-top: 2vh;
      margin-bottom: 2vh;
      width: 96%;
      display: block;
      margin-left: 2%;
      margin-right: 2%;
      border-radius: 10px;
      height: 74.5vh;
      overflow-y: scroll;
      border: none;
      z-index: 9999;
      -webkit-appearance: none;
      -webkit-box-shadow: 0px 2px 10px -1px rgba(0,0,0,0.45);
      -moz-box-shadow: 0px 2px 10px -1px rgba(0,0,0,0.45);
      box-shadow: 0px 2px 10px -1px rgba(0,0,0,0.45);
    }
    .footer{
      display: block;
      position: relative;
      height: 10vh;
      bottom: 0;
      left: 0;
      right: 0;
      background-color: yellow;
    }
  </style>
  <body>
    <div class='head'></div>
    <div class='emb-content'>
      <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>add
    </div>
    <div class='footer'></div>
  </body>
</html>

刪除z-index:-9999; , z-index < 0 在 ios 14 中不受支持

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM