Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将 Main 和 content 设为红色?我究竟做错了什么?当我输入时
<div id="main"> <div id="content">
main 和 content 以蓝色显示,它们应该以红色显示。谢谢!
除了您在评论中发布的代码段外,我看不到代码。
问题:您想要改变背景或文本颜色吗?
此外,您使用的选择器错误。只需在#main,#content.
#main,#content
把它放在你的 CSS 文件中:
#main, #content{color:red;}
我希望这有帮助!