我正在建立一个包含iframe的网站,正在使用bulma对其进行样式设置。无论如何,是否有要移除iframe侧面的灰色滚动条。我设置了overflow:hidden,但它没有解决问题。带栏的iframe如下所示。
示例代码演示这一点:
iframe:
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css">
<script defer src="https://use.fontawesome.com/releases/v5.1.0/js/all.js"></script>
</head>
<body style = 'overflow:hidden'>
<p>hello<p>
</body>
网页:
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css">
<script defer src="https://use.fontawesome.com/releases/v5.1.0/js/all.js"></script>
</head>
<body>
<iframe src = 'iframe.html'></body>
</iframe>
</body>
答案 0 :(得分:0)
在iframe中添加<html style = 'overflow-y:hidden'>
会删除滚动条。