为什么我在大的div里嵌套几个小div,前两个可以但是后边定位就一直出错?
我的源码是这样的:<!DOCTYPEhtml><html><head><metachaeset="UTF-8"><linkhref="CSSStyle/style.css...
我的源码是这样的:
<!DOCTYPE html>
<html>
<head>
<meta chaeset="UTF-8">
<link href="CSS Style/style.css" rel="stylesheet" type="text/css">
<title>Home Page</title>
<link rel="icon" href="Images/GreenB icon.ico" />
</head>
<body>
<div id="main">
<div id="contentbg">
<div id="header">
<a href="index.html"><img src="Images/GreenB.gif" style="height: 100px; left: 10px; position:relative; top: 14px;float:left;"></a>
green B</div>
<div id="subHeader">
<div id="signup">Login Or Signup</div>
<div id="slogan">Making life better and easier</div>
<div id="Fackbook"><img src="Images/facebook-icon.png" style="height:38px; width:38px;"></div>
<div id="Twitter"><img src="Images/twitter-icon.png" style="height:38px; width:38px;"></div>
</div>
</div>
</div>
</body>
</html>
CSS是这样的:
@charset "utf-8";
/* CSS Document */
body{
margin: 0px;
padding: 0px;
background-image: url(../Images/Bg.jpg);
background-repeat:repeat-y,x;
}
#main
{
width:899px;
float:none;
margin:0 auto;
padding:0px;
}
#contentbg{
width:899px;
height:4000px;
float:left;
margin:0px;
padding:0px;
background-color:#DFD8C9;
}
#header{
width:899px;
height:137px;
folat:left;
font-family: "Bradley Hand ITC";
font-size: 88px;
margin:0px;
padding:0px;
alignment-adjust: central;
text-align:center;
color:green;
}
#subHeader{
height:52px;
width:899px;
background-color:black;
margin:0px;
padding:0px;
}
#signup{
width:175px;
height:52px;
margin:0px;
padding:0px;
font-family:"Blackadder ITC";
float:left;
font-size:17pt;
color:green;
}
#slogan{
margin:0px;
padding:0px 0 0 300px;
height:52px;
width:300px;
left:530px;
font-family:"Blackadder ITC";
font-size:30px;
color:green;
}
#Fackbook{
margin:0px;
padding:0px 0 0 0;
width:38px;
height:38px;
background-color:black;
}
#Twitter{
margin:0px;
padding:0px;
width:38px;
height:38px;
background-color:black;
}
就是黑条下面的方框我想把它移到黑条里面的右边 展开
<!DOCTYPE html>
<html>
<head>
<meta chaeset="UTF-8">
<link href="CSS Style/style.css" rel="stylesheet" type="text/css">
<title>Home Page</title>
<link rel="icon" href="Images/GreenB icon.ico" />
</head>
<body>
<div id="main">
<div id="contentbg">
<div id="header">
<a href="index.html"><img src="Images/GreenB.gif" style="height: 100px; left: 10px; position:relative; top: 14px;float:left;"></a>
green B</div>
<div id="subHeader">
<div id="signup">Login Or Signup</div>
<div id="slogan">Making life better and easier</div>
<div id="Fackbook"><img src="Images/facebook-icon.png" style="height:38px; width:38px;"></div>
<div id="Twitter"><img src="Images/twitter-icon.png" style="height:38px; width:38px;"></div>
</div>
</div>
</div>
</body>
</html>
CSS是这样的:
@charset "utf-8";
/* CSS Document */
body{
margin: 0px;
padding: 0px;
background-image: url(../Images/Bg.jpg);
background-repeat:repeat-y,x;
}
#main
{
width:899px;
float:none;
margin:0 auto;
padding:0px;
}
#contentbg{
width:899px;
height:4000px;
float:left;
margin:0px;
padding:0px;
background-color:#DFD8C9;
}
#header{
width:899px;
height:137px;
folat:left;
font-family: "Bradley Hand ITC";
font-size: 88px;
margin:0px;
padding:0px;
alignment-adjust: central;
text-align:center;
color:green;
}
#subHeader{
height:52px;
width:899px;
background-color:black;
margin:0px;
padding:0px;
}
#signup{
width:175px;
height:52px;
margin:0px;
padding:0px;
font-family:"Blackadder ITC";
float:left;
font-size:17pt;
color:green;
}
#slogan{
margin:0px;
padding:0px 0 0 300px;
height:52px;
width:300px;
left:530px;
font-family:"Blackadder ITC";
font-size:30px;
color:green;
}
#Fackbook{
margin:0px;
padding:0px 0 0 0;
width:38px;
height:38px;
background-color:black;
}
#Twitter{
margin:0px;
padding:0px;
width:38px;
height:38px;
background-color:black;
}
就是黑条下面的方框我想把它移到黑条里面的右边 展开
2个回答
展开全部
#slogan中加一个:float:left;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询