我在一个页面上有一个 iframe,里面有另一个页面。我想隐藏滚动条,但我找不到任何解决方案。我试过,overflow: hidden;但它不起作用。
见下面的代码:
<iframe frameborder="0" src="https://google.com/"></iframe>
Run Code Online (Sandbox Code Playgroud)
CSS 代码:
iframe{
overflow: hidden;
}
Run Code Online (Sandbox Code Playgroud) 我为照片设置了一个模态,所以当我点击一张小照片时,我会在一个模态中获得一张更大的照片,该模态具有position: fixed;模态内容,position: absolute;我可以将其居中,margin: auto; left: 0; right: 0;但随后宽度一直到左右,我希望模态内容宽度与其中的照片或模态内容的内容相同
我的代码:
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
padding: 30px;
left: 0;
top: 0;
right: 0;
bottom: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity …Run Code Online (Sandbox Code Playgroud)