如何将在另一个中水平居中?
这里我有一个html格式和一个css文件(style.css)。“o-div”是外部div,“i-div”是内部div类。
示例
<html >
<head>
<title>center a div</title>
<link href="../../Content/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="o-div">
I am OUTER DIV
<div class="i-div">
I am INNER DIV,
I am in Center
</div>
</div>
</body>
</html>Style.css
body {
background-color:Gray;
padding:30px;
}
.o-div {
padding:50px;
background-color:Lime;
}
.i-div {
background-color:Fuchsia;
max-width:400px;
height:200px;
margin: 0 auto;
text-align:center;
}
热门推荐
6 保研的祝福语简短
10 年轻20岁祝福语简短
11 朋友结婚祝福语信息简短
12 女孩婚礼贺卡祝福语简短
13 30段点歌简短祝福语
14 虎年春节祝福语图文简短
15 写给后妈祝福语大全简短
16 简短回复生日祝福语
17 校长送毕业祝福语简短
18 毕业立体贺卡祝福语简短
中水平居中?
这里我有一个html格式和一个css文件(style.css)。“o-div”是外部div,“i-div”是内部div类。
示例
<html >
<head>
<title>center a div</title>
<link href="../../Content/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="o-div">
I am OUTER DIV
<div class="i-div">
I am INNER DIV,
I am in Center
</div>
</div>
</body>
</html>Style.css
body {
background-color:Gray;
padding:30px;
}
.o-div {
padding:50px;
background-color:Lime;
}
.i-div {
background-color:Fuchsia;
max-width:400px;
height:200px;
margin: 0 auto;
text-align:center;
}热门推荐
6 保研的祝福语简短
10 年轻20岁祝福语简短
11 朋友结婚祝福语信息简短
12 女孩婚礼贺卡祝福语简短
13 30段点歌简短祝福语
14 虎年春节祝福语图文简短
15 写给后妈祝福语大全简短
16 简短回复生日祝福语
17 校长送毕业祝福语简短
18 毕业立体贺卡祝福语简短