我多次检查了我的代码。我看不出它有什么问题。我可以改变旁边标签中除了新闻之外的所有内容。它有什么问题?这是css代码。我打电话给旁边的标签新闻。我的旁边标签的id在html中是正确的。在问这个问题之前我检查了一下。
*{
margin: 0px;
padding: 0px;
}
h1{
font: bold 20px Tahoma;
}
h2{
font: bold 14px Comic Sans MS;
}
header,section,footer,aside,article,nav,hgroup{
display:block;
}
body{
text-align:center;
}
#whole_wrapper{
border:1px solid brown;
width: 1000px;
margin: 20px auto;
text-align: left;
background-color:orange;
}
#top_header{
background:beige;
padding: 20px;
}
#main_menu{
background:lightgreen;
color:blue;
}
#main_menu li{
display:inline-block;
list-style:none;
padding:5px;
font: bold 14px Tahoma;
}
#main_section{
float:left;
width:660px;
margin:30px;
}`
#news{
float:left;
width:220px;
margin:20px 0px;
padding:30px;
background-color:red;
}
#bottom_footer{
clear:both;
text-align:center;
padding:20px;
border-top:2px solid beige;
}
article{
background-color:azure;
border: 1px solid navy;
padding:20p;
margin-bottom:15px;
}
答案 0 :(得分:1)
你的CSS中有各种拼写错误。此外,请务必指定特定颜色,而不是blue
或beige
等声明。在这里它被清理干净,没有对颜色进行编辑。
*{
margin: 0px;
padding: 0px;
}
h1{
font: bold 20px Tahoma;
}
h2{
font: bold 14px Comic Sans MS;
}
header, section, footer, aside, article, nav, hgroup{
display:block;
}
body{
text-align:center;
}
#whole_wrapper{
border:1px solid brown;
width: 1000px;
margin: 20px auto;
text-align: left;
background-color: orange; /* Use a specific color instead */
}
#top_header{
background: beige; /* Use a specific color instead */
padding: 20px;
}
#main_menu{
background:lightgreen; /* Use a specific color instead */
color:blue;
}
#main_menu li{
display:inline-block;
list-style:none;
padding:5px;
font: bold 14px Tahoma;
}
#main_section{
float:left;
width:660px;
margin:30px;
}
#news{
float:left;
width:220px;
margin:20px 0px;
padding:30px;
background-color:red; /* Use a specific color instead */
}
#bottom_footer{
clear:both;
text-align:center;
padding:20px;
border-top:2px solid beige; /* Use a specific color instead */
}
article{
background-color:azure; /* Use a specific color instead */
border: 1px solid navy; /* Use a specific color instead */
padding:20p;
margin-bottom:15px;
}