iOS端html中的iframe樣式錯誤(滾動條消失)
阿新 • • 發佈:2019-01-04
標題專案中需要將html頁面分別封裝成安卓app和iOS,頁面在安卓上執行正常,但是在iOS中,iframe樣式錯誤,沒有了滾動條,將頁面撐開了(iframe中引用的是富文字編輯器頁面)
標題解決方案:在iframe外套一層div,設定div的樣式
程式碼:
.warpper {
overflow: auto;
-webkit-overflow-scrolling: touch;
width: 80%;
height: 420px;
margin-left: 10%;
margin-top: 3%;
border: 1 px solid black
}
<div style="margin-top: 3%;margin-left: 10%">富文字(可包含圖片):</div>
<div class="warpper">
<iframe id="itemIframe" src="/ueditor/index.html" frameborder="0" height="100%" width="100%"></iframe>
</div>