- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
body{
background-color: #f2f2f2;
}
#content{
background-color: white;
border: 1px solid gray;
width: 60%;
height: auto;
display: block;
position: relative;
left: 50%;
margin-left: -30%;
padding: 10px;
z-index: 100;
margin-top: 20px;
}
html, body {
height: auto;
}
#wrap {
min-height: 100%;
}
#main {
overflow:auto;
padding-bottom: 150px;
} /* must be same height as the footer */
#footer {
position: relative;
margin-top: -150px; /* negative value of footer height */
height: 150px;
clear:both;
}
.instructions{
margin-top: 50px;
font-family: serif;
font-size: medium;
width: 50%;
left: 50%;
margin-left: -25%;
position: relative;
margin-bottom: 60px;
}
.repbanner{
background-color: red;
width: 108%;
height: auto;
left: 50%;
margin-left: -54.5%;
margin-top: 40px;
position: relative;
z-index: 200;
border: 1px #a70000 solid;
text-align: center;
color: white;
font-size: smaller;
text-transform: uppercase;
padding-top: 3px;
padding-bottom: 3px;
}
.dembanner{
background-color: blue;
width: 108%;
height: auto;
left: 50%;
margin-left: -54.5%;
margin-top: 40px;
position: relative;
z-index: 200;
border: 1px navy solid;
text-align: center;
color: white;
font-size: smaller;
text-transform: uppercase;
padding-top: 3px;
padding-bottom: 3px;
}
.introbanner{
background-color: white;
width: 108%;
height: auto;
left: 50%;
margin-left: -54.5%;
margin-top: 40px;
position: relative;
z-index: 199;
border: 1px gray solid;
text-align: center;
color: black;
font-size: smaller;
text-transform: uppercase;
margin-bottom: 10px;
}
/*Opera Fix*/
body:before {
content:"";
height:100%;
float:left;
width:0;
margin-top:-32767px;/
}
#animals{
width: 100%;
margin-left: 5px;
margin-right: 5px;
margin-bottom: 5px;
text-align: center;
position: relative;
display: block;
height: auto;
}
.animalmugshot{
width: 150px;
height: 150px;
float: left;
position: relative;
}
img{
position: relative
}
</style>
<!--[if !IE 7]>
<style type="text/css">
#wrap {display:table;height:100%}
</style>
<![endif]-->
</head>
<body>
<div id="wrap">
<div id="main">
<div id="content">
<div class="repbanner">
INTRODUCTION
</div>
<div class="instructions">
Hello and thanks for using the Chrome extension Political Animals. Below are the instructions on how the piece works. Enjoy!
<br/>
<br/>
</div>
<div class="dembanner">
Instructions
</div>
<div class="instructions">
Here's how the project works!
1. Surf the Web. Try any website you would like.
2. You should be redirected to a news site. Do not be alarmed!
3. Enjoy!
</div>
<div class="introbanner">
Meet the Cast
</div>
<div id="animals">
<div class="animalmugshot">
<img src="animalshots/thumbnails/PoliticalAnimal.png" alt="Charlie the CEO"/><br/><p>Charlie the CEO</p>
</div>
<div class="animalmugshot">
<img src="animalshots/thumbnails/PoliticalFox.png" alt="Freddy the Financial Agent"/>
<br/>
<p> Freddy the Financial Agent</p>
</div>
<div class="animalmugshot">
<img src="animalshots/thumbnails/PoliticalGiraffe.png" alt="Geoffry the Graphic Designer"/>
<br/>
<p>Geoffry the
<br/>Graphic Designer</p>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
</div>
</body>
div“animals”和“animalmugshots”应该在“wrapper”和“content”中,但由于某种原因,动物溢出了白色的“content”正文部分。我很困惑为什么?希望有人能帮助我!
最佳答案
#animals
元素在子元素 float 时自行折叠。
float 和绝对定位的元素被排除在文档流之外,因此导致父元素以未定义的尺寸折叠。
为父元素添加定义的高度,或者 overflow:hidden
将解决这个折叠问题。
Working example - 出于可见性目的将页脚设为黑色。
#animals {
width: 100%;
margin-left: 5px;
margin-right: 5px;
margin-bottom: 5px;
text-align: center;
position: relative;
display: block;
height: auto;
overflow: hidden; /* Added this.. */
}
关于html - Css 粘性页脚导致图像不适合 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20151546/
我有一个脚本,允许在向下移动时快速滚动,但我无法让它允许用户向上滚动。 var items = $(".item"); var animating = false; $(window).scroll(
所以我已经尝试解决这个问题几个小时了。有一个双层子菜单。如果子菜单的内容超出视口(viewport),则当您滚动时子菜单项不会滚动。 click here to view the site 最佳答案
有什么方法可以控制移动浏览器中用户在可滚动元素中滚动的速度或粘性吗? 我专注于 android 浏览器。 最佳答案 不,滚动速度由浏览器控制(通常直接由计算机/设备上的设置控制)。我认为您的代码不会影
我正在尝试使用 Haproxy 1.6.3 2015/12/25 和粘性 session 。我按照haproxy manual做的一切,但是,不幸的是,检查客户端浏览器我发现没有添加 cookie(平
清理并重建后,Eclipse Problems View 中出现错误标记,尽管一切都应该没问题。 如何消除这种不一致的错误? 最佳答案 在这里,我回答自己接下来的步骤对我有用: 关闭 Eclipse
我用这个脚本制作了粘性 div - $(window).scroll(function() { var leedoffset = $('.leed_block').offset().top;
我希望我的 div 调用:如果我向下滚动,top 将粘在顶部,但现在它不会粘在顶部。 我在这段代码中使用 jQuery: $(window).scroll(function(){ if (
早上好,我正在为我的网站制作一个粘性 header ,我已经让它工作了,但它似乎卡入到位,我想要顺利!我该怎么做? 我的网站:http://www.trevorpeters.co.uk/tpwebde
我有一个用于我正在处理的小测试站点的导航栏,我需要一些帮助。我正在使用 Bootstrap(您可能会说)但无法弄清楚如何在您向下滚动时让我的导航栏保持在屏幕顶部。我希望导航栏保持在超大屏幕下方,直到您
我的页脚设计为位于页面底部,即使其上方的 div 仅包含少量内容。它直到最近才起作用,我似乎以某种方式破坏了它。你能看看吗? 提前致谢。 CSS: body { margin: 0;
我想在加载时让整个 UI 适合屏幕,但我的页脚没有固定在移动设备上的 View 底部。 在桌面网络浏览器上,它可以完美运行。当我在移动网络浏览器上查看此内容时,页脚位于页面下方,使页面可滚动。它不应该
我有一个问题。我正在创建一个由页眉、正文和页脚组成的单栏网站。在调整大小时,我可以让页脚粘在页面底部,但我的问题是这样的。如何让窗口在调整大小时“吃掉”页脚 div 而不是将其向上推?一个很好的例子是
我正在尝试实现一个粘性标题,在滚动超过 100-150 像素之前不会发生任何事情。向上滚动时它会显示出来,向下滚动时它会再次隐藏,当您滚动回页面顶部时也会返回到它的原始状态。 这正是我想要的外观/感觉
我正在使用一个名为“Thematosoup 的 Sticky header”的 WordPress 插件,我对此非常满意,但标题仅出现在一些像素之后,并不总是在顶部可见。有谁知道我如何修改代码以使其始
我目前正在创建一个网站,遇到了一个问题,每当我滚动我的粘性标题时,页面就会跳到下一个元素的底部,有人知道这是为什么吗? 我已经尝试更改页面上基本上所有元素的填充,包括横幅、标题、文本本身,甚至 anc
我创建了一个简单的表格,顶部应该有粘性标题 (TR)。但这不起作用。我该如何修复此代码? 谢谢 HELLO hello 5hello 5 hello 5hello 5 HELLO T
使用我当前的代码,当页面加载时,白色条形标题位于顶部。当你滚动时,它会消失,当你滚动到顶部时,白色标题又回来了。所以我取得了一些进步。我想要得到的是当滚动条在顶部时有一个透明的标题:(https://
我到处都看到这个问题的变体,但似乎没有一个能解决我的问题。我有一个高大的页面,由于内容原因已经有一个 Y 滚动条。部分内容是一个div style="position: relative;",暂且称之
我创建了一个 header ,位置设置为粘性,顶部设置为 0。但是,如果我向下滚动页面,标题会在某个时候停止随页面滚动。 我认为这很容易解决,但我太笨了... 我试图删除其他元素,因为我认为它们与标题
我的代码有点卡在粘性 header 上。 如果达到 770px 点,标题将缩小。但是当我尝试在浏览器上进行测试时,这会给我带来一些问题。尝试在全尺寸浏览器中加载页面(>770)并将其缩小到(770),
我是一名优秀的程序员,十分优秀!