我试图解决这个作业。它说:我的CSS代码有什么问题?得到错误的输出
我需要编写CSS代码,执行以下操作:
•旁白:500个像素宽
•中心浏览器窗口的75%
•页脚底部
这是我的HTML:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>Welcome to Our Site</title>
<!-- google font -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,600' rel='stylesheet' type='text/css'>
<!-- style css -->
<style>
body {
background-image: url('super_hero.png');
margin: 0;
padding: 0;
height: 100%;
}
.container {
width: 75%;
margin: auto;
height: 100%;
background-color: activeborder;
position: relative
}
#body {
padding: 10px;
padding-bottom: 30px;
/* Height of the footer */
min-height: calc(100% - 60px);
}
.heder {
width: 100%;
height: 30px;
background-color: antiquewhite
}
.footer {
width: 100%;
height: 30px;
background-color: beige;
}
.aside {
width: 500px;
float: right;
}
.section {
height: 100%;
float: left;
width: calc(100% - 500px);
}
</style>
</head>
<body>
<div class="container">
<div class="heder">
</div>
<div id="body">
<div class="section">
<p>section</p>
</div>
<div class="aside">
<p>aside section</p>
</div>
</div>
<div class="footer">
<p>this is footer</p>
</div>
</div>
</body>
</html>
但是,我得到一个非常输出的bizzare这看起来不像的问题。谁能帮忙?
可以还张贴erronous输出的模样? – Thomas
你已经使用了固定的一边,因此如果屏幕尺寸小于500像素,那么它会产生问题。 – Mitul
你可以运行代码片段,它看起来不像图像....或者它是正确的吗?我很困惑。老师说它应该看起来完全像图片 – skeptirit