gpt4 book ai didi

html - 无法更改 aside 标签 html5 中元素的背景

转载 作者:太空宇宙 更新时间:2023-11-04 15:03:40 25 4
gpt4 key购买 nike

我多次检查了我的代码。我看不出有什么问题。除了旁边标签中的新闻,我可以更改所有内容的背景。它出什么问题了?这是CSS代码。我调用旁边的标签新闻。我的 aside 标签的 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;
}

最佳答案

您的 CSS 中有各种拼写错误。此外,请务必指定特定的颜色,而不是声明,例如 bluebeige。此处已清理干净,未对颜色进行任何编辑。

*{
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;
}

关于html - 无法更改 aside 标签 html5 中元素的背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16152156/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com