Dreamweaver中div怎么页面居中?
Dreamweaver中div怎么页面居中?我写的DIV都是靠左,怎么让它页面居中?在html中添加代码还是CSS中?请帮我修改下!html:<!doctypehtml>...
Dreamweaver中div怎么页面居中?我写的DIV都是靠左,怎么让它页面居中?在html中添加代码还是CSS中?请帮我修改下!
html:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>某某公司</title>
<link href="index.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="header">
<div class="logo"><img src="images/logo.jpg" width="162" height="149" alt=""/></div>
<div class="nav"> 毛衣 T衫 短袖 长袖</div>
</div>
</body>
</html>
CSS:
@charset "utf-8";
/* CSS Document */
.header{
width:900px;
height:149px;
background-image:url(images/index1.jpg)
}
.logo{
width:162px;
height:149;
float:left
}
.nav{
width:590px;
height:149px;
float:right;
color:#F9F9F9;
font:20px;
font-family:"微软雅黑";
line-height:150px;
text-align:center;
letter-spacing:15px;
} 展开
html:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>某某公司</title>
<link href="index.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="header">
<div class="logo"><img src="images/logo.jpg" width="162" height="149" alt=""/></div>
<div class="nav"> 毛衣 T衫 短袖 长袖</div>
</div>
</body>
</html>
CSS:
@charset "utf-8";
/* CSS Document */
.header{
width:900px;
height:149px;
background-image:url(images/index1.jpg)
}
.logo{
width:162px;
height:149;
float:left
}
.nav{
width:590px;
height:149px;
float:right;
color:#F9F9F9;
font:20px;
font-family:"微软雅黑";
line-height:150px;
text-align:center;
letter-spacing:15px;
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询