我正在尝试让我的标题背景使用 css 更改颜色,但是除了我的导航位置之外,我无法更改任何其他内容 <div>
.
https://jsfiddle.net/70d40nnt/2/
<style type="text/css">
#header {
background:#7D72F7;
text-align:center;
padding:5px;
}
.clearfix {
overflow: auto;
}
#nav {
line-height:30px;
background-color:#eeeeee;
height:200px;
width:150px;
float:right;
padding:5px;
text-align:center;
}
#section {
width:350px;
padding:10px;
float:left;
}
</style>
最佳答案
删除 <style></style>
从你的样式表和你的 jsfiddle 作品。实际上,只有 html 页面内的 css 指令才需要它们。
关于html - header 未使用 CSS 更改样式,但其他 div 是,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34993929/