- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
<body>
<div id = "wrapper">
<div id = "video">
</div>
</div>
<div id = "footer">
<div id = "footercontent">
</div>
</div>
</body>
*
{
margin: 0px;
padding: 0px;
}
.selfclear:after
{
content: ".";
float: left;
display: block;
height: 0;
clear: both;
visibility: hidden;
}
html, body
{
height: 100%;
}
#wrapper
{
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -343px; /* the bottom margin is the negative value of the footer's height */
width: 100%;
background: url( "images/landing_page_bg.png" );
}
#video
{
width: 940px;
height: 530px;
background: black;
margin-left: auto;
margin-right: auto;
margin-top: 100px;
}
#footer
{
height: 343px; /* .push must be the same height as .footer */
background: url( "images/Landing_page_Footer.png" )no-repeat;
background-size: 100%;
background-color: black;
width: 100%;
}
#footercontent
{
height: 100%;
width: 1920px;
margin-left: auto;
margin-right: auto;
}
最佳答案
我不确定我是否理解您的问题,但您应该首先解决一些问题。
首先,您应该在设置任何样式之前使用 css 重置。 Eric Myers' Reset可能是最常用的,以一种或另一种形式。
其次,您的格式有误,这本身可能会导致奇怪的问题。
这是经过最小重置的清理代码:
<body>
<div id="wrapper">
<div id="video">
</div>
</div>
<div id="footer">
<div id="footercontent">
</div>
</div>
</body>
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video
{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;}
* {-webkit-font-smoothing: subpixel-antialiased !important; text-rendering:optimizeLegibility;}
html {height:100%;}
.selfclear:after { /* not sure what this is being used for */
content: ".";
float: left;
display: block;
height: 0;
clear: both;
visibility: hidden;
}
#wrapper {
width: 100%;
height: auto !important;
margin-bottom: -343px; /* the bottom margin is the negative value of the footer's height */
/* Are you wanting for the footer to be pulled up and overlap your wrapper DIV? */
background: url('images/landing_page_bg.png') no-repeat 0 0;
}
#video {
width: 940px;
height: 530px;
margin: 100px auto 0 auto; /* You can include all margins in a shorthand statement ~ TOP RIGHT BOTTOM LEFT */
background: black;
}
#footer {
width: 100%;
height: 343px; /* .push must be the same height as .footer */
background: url('images/Landing_page_Footer.png') no-repeat 0 0;
/* background-size is NOT VALID or needed. Set the size of the container and repeat or no-repeat accordingly - background-size: 100%; */
background-color: black;
}
#footercontent {
width: 1920px;
height: 100%;
margin:0 auto; /* shorthand again TOP/BOTTOM LEFT/RIGHT */
}
关于html - 为什么内部 div 顶部边距会带来它的包装 div 顶部边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6951425/
当我为我的项目运行“mvn dependency:tree”时,它显示如下: [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ x
我调用 ajax 的脚本 function search_func(value) { $.ajax({ type: "GET", url: "sample.php
我正在使用 SIM 安装 Sitecore 8.1,但在打开启动板时,由于 ajax 请求返回 HTTP 500 错误,出现了几个 Javascript 错误。查看开发人员工具会显示以下消息: htt
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我有一张 table : +-----------+-------------+------+-----+---------+-------+| Field | Type | N
所以,我对这个阵列很生气,第 2 天让我感到疼痛 *.... 我正在开发面向对象的 PHP 脚本。 我得到一个数组: Array ( [0] => Project Object ( [project_
我正在尝试将我的一个 Rails 项目升级到 Ruby 1.9.2。一切进展顺利,但一个 RSpec 测试失败了。在这个测试中,我需要一个Ruby lib: # file spec/models/my
我可以使用 Maven 的插件 spring-boot:run 运行 Spring Boot,但是当我尝试执行打包的 jar 时,它给出: Error creating bean with name
我是一名优秀的程序员,十分优秀!