我不知道造成这种情况的原因。
我在我的页面上添加了一个div,它将成为我的页脚的包装器
(class = main_foot)
它被困在左上角。
目标:将div移到div class =" main_content"
下面我检查过以确保样式表,位置标记,idk中元素的类是正确的。它似乎没有移动。
希望有人能注意到这个问题。
这是我添加的最后一个div。
JS小提琴: http://jsfiddle.net/73mK8/1/
的header.php
<html>
<head>
<html>
<head>
<title> Crazy Fat Wrap* </title>
<link href="../CSS/nav.css" rel="stylesheet" type="text/css">
<link href="../CSS/normalize.css" rel="stylesheet" type="text/css">
<link href="../CSS/body.css" rel="stylesheet" type="text/css">
<link href="../CSS/stylesheet.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript"><!--//--><![CDATA[//><!--
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]></script>
</head>
<body>
<div class="solid_banner">
<h1> Crazy Fat Wrap </h1>
<!--above the Main Nav -->
<ul class="soc">
<li><a href="#"><img src="../images/soc/Facebook.png"></a></li>
<li><a href="#"><img src="../images/soc/GMail.png"></a></li>
<li><a href="#"><img src="../images/soc/Contacts.png"></a></li>
<li><a href="#"><img src="../images/soc/Phone.png"></a></li>
</ul>
</div>
<div class="nav_bar">
<?php include('nav.php'); ?>
<!--///// head_bar div-->
</div>
<div class="orange_strip">
</div>
<div class="feat_head">
<img src="../images/shanesfacebook.jpg">
</div>
<div class="main_content">
<div class="main_content_img">
<!-- /// /// main content article -->
<img src="../images/flag.jpg">
</div>
<!-- /// main content article -->
<div class="main_content_copy">
<h2>Lorem Ipsum</h2>
<article>
Fusce auctor, metus eu ultricies vulputate, sapien nibh faucibus ligula, eget sollicitudin augue risus et dolor. Aenean pellentesque, tortor in cursus mattis, ante diam malesuada ligula, ac vestibulum neque turpis ut enim. Cras ornare. Proin ac nisi. Praesent laoreet ante tempor urna. In imperdiet. Nam ut metus et orci fermentum nonummy. Cras vel nunc. Donec feugiat neque eget purus. Quisque rhoncus. Phasellus tempus massa aliquet urna. Integer fringilla quam eget dolor. Curabitur mattis. Aliquam ac lacus. In congue, odio ut tristique adipiscing, diam leo fermentum ipsum, nec sollicitudin dui quam et tortor. Proin id neque ac pede egestas lacinia. Curabitur non odio.
</article>
</div>
</div>
<!-- foooter . php begin --- >
<div class="main_foot">
<div class="main_footer_copy">
<!-- /////////// Main Footer Article-->
<h2>Call To Action</h2>
<article>
Fusce auctor, metus eu ultricies vulputate, sapien nibh faucibus ligula, eget sollicitudin augue risus et dolor. Aenean pellentesque, tortor in cursus mattis, ante diam malesuada ligula, ac vestibulum neque turpis ut enim. Cras ornare. Proin ac nisi. Praesent laoreet ante tempor urna. In imperdiet. Nam ut metus et orci fermentum nonummy. Cras vel nunc. Donec feugiat neque eget purus. Quisque rhoncus. Phasellus tempus massa aliquet urna. Integer fringilla quam eget dolor. Curabitur mattis. Aliquam ac lacus. In congue, odio ut tristique adipiscing, diam leo fermentum ipsum, nec sollicitudin dui quam et tortor. Proin id neque ac pede egestas lacinia. Curabitur non odio.
</article>
</div>
<!-- /////////// Main Footer Img-->
<div class="main_footer_img">
<!-- /// /// main content article -->
<a href="#"><img src="../images/shanesbizcard.jpg"></a>
</div>
</div>
</body>
</html>
stylesheet.css中
.solid_banner {
width: 100%;
height: 70px;
position: fixed;
z-index: 55;
top: 0;
background: rgba(255, 115, 67, 0.9);
}
.solid_banner h1 {
padding:19px 5%;
}
.nav_bar {
z-index: 55;
position: fixed;
top: 70px;
right: 25%;
align-content: center;
}
.space {
height: 3000px;
}
.soc {
position: fixed;
list-style:none;
top: 0;
right: 50px;
}
.soc li {
display:inline-block;
padding: 0 5px;
}
.soc img {
height: 40px;
width: 55px;
opacity: .7;
}
.soc img:hover {
opacity: 1;
}
.feat_head {
position: absolute;
margin: 205px 15%;
width: auto;
height: 550px;
z-index: 30;
border: 10px solid rgba(0,0,0,.7);
}
.feat_head img {
width: 100%;
height: 550px;
}
.main_content {
background: #ff7343;
position:absolute;
margin: 815px 15%;
width: auto;
border-radius: 5px;
box-shadow: 0 0 5px black;
/* //// / /// / /// 85%*/
}
.main_content_img {
width: 25%;
display:inline-block;
padding: 2.5%;
}
.main_content_img img {
border-radius: 5px;
}
.main_content_copy {
width: 45%;
height: 500px;
padding: 0 10%;
display:inline-block;
vertical-align:top;
text-align: left;
padding-top: 100px;
}
.main_content_copy article {
height: 500px;
width: 100%;
}
.main_content_copy h2 {
text-align: center;
}
.main_content_copy article:first-letter {
font-size: 1.3em;
font-weight:bold;
}
/////问题从这里开始
.main_foot {
background: #ff7343;
position:absolute;
margin: 1915px 15% 0 !important;
width: auto;
height: 900px;
border-radius: 5px;
box-shadow: 0 0 5px black;
}
答案 0 :(得分:0)
尝试这些更改
css change
.feat_head {
margin: 205px 15%;
width: auto;
height: 550px;
z-index: 30;
border: 10px solid rgba(0,0,0,.7);
}
.main_content {
display: block;
float: left;
background: #ff7343;
width: auto;
border-radius: 5px;
box-shadow: 0 0 5px black;
}
.main_content_copy {
width: 45%;
height: 500px;
padding: 0 10%;
display:block;
float: left;
vertical-align:top;
text-align: left;
padding-top: 100px;
}
.main_foot {
clear: both;
display: block;
float: left;
background: #ccc;
width: 100%;
height: 900px;
border: 1px solid #F00;
}
html更改
<!-- foooter . php begin --- >
到
<!-- foooter . php begin --->