gpt4 book ai didi

css - iframe 覆盖 div 页脚

转载 作者:行者123 更新时间:2023-11-28 10:24:12 25 4
gpt4 key购买 nike

我的网站存在一些问题,主 iframe(100% 高度)在页脚下方。这会导致页面底部被页脚隐藏。

我假设我用我的代码做了一些非常奇怪或愚蠢的事情,我希望有人能看到我犯的错误。

HTML:

<html class="index">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="index.css" />
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,300|Playfair+Display:900italic' rel='stylesheet' type='text/css'>

<title>Title</title>

</head>
<body>
<div class="heading">Header text</div>
<iframe src="menu.php" name="list" class="menu"></iframe>
<iframe src="dashboard.php" name="dashboard" class="dashboard"></iframe>

<div class="footer">20&copy;14</div>
</body>
</html>

CSS:

body {
margin: 0px 0px 0px 0px;
}

html.index {
background: url(static/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
height: 100%;
min-height: 100%;
}

html {
position: relative;
min-height: 100%;
}

div.heading {
font-family: 'Playfair Display', serif;
font-weight: bold;
font-style:italic;
font-size:36px;
color: #FFFFFF;
position: fixed;
width: 100%;
height: 50px;
background-color: rgba(0,0,0,0.7);
text-align: center;
line-height: 50px;
}

div.footer {
font-family: 'Roboto', sans-serif;
font-weight: 300;
font-size: 14px;
color: #FFFFFF;
width: 90%;
height: 25px;
position: fixed;
bottom: 0px;
left: 10%;
background-color: rgba(0,0,0,0.6);
text-align: right;
line-height: 25px;
}

iframe.dashboard {
border: 0;
position: fixed;
top: 50px;
bottom: 25px;
left:10%;
min-height:100%;
width:90%;
overflow-y: scroll;
opacity:0.8;
}

iframe.menu {
border: 0;
position: fixed;
top: 50px;
left: 0px;
min-height: 100%;
width: 10%;
overflow-y: scroll;
background-color: rgba(0,0,0,0.6);
}

最佳答案

怎么样:

Fiddle

问题是您不能在 iframe.dashboard 上设置 topbottom 属性,但您知道它的偏移量需要是 25px(从底部算起)加上 50px(从顶部算起),这样您就可以将高度相应地偏移 75px

参见:http://css-tricks.com/a-couple-of-use-cases-for-calc/

关于css - iframe 覆盖 div 页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23823454/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com