如何在HTML中连接部分ID 由 櫻花~祭发布于 2020-05-24 05:47:02 csshtml 收藏 我刚开始和一些朋友一起学习HTML / CSS,我们开始做一个项目,做了一部分,但是当我们将Html和Css连接到一个文件中时,它们混合在一起并丢失了元素 评论 请 登录后发表观点 你,不配我 2020-05-24 05:47:02 <section> is also an element also <section id="para1"> assigns it an id The CSS rule below will be applied to the HTML element with id="para1": #para1 { text-align: center; color: red; } In this example only <p> elements with class="center" will be center-aligned: p.center { text-align: center; color: red; } In this example all HTML elements with class="center" will be red and center-aligned: .center { text-align: center; color: red; } 如果您还有其他疑问,请在评论中注明。或者,如果您需要更多帮助,请使用一些代码扩展您的问题,以便我检查。 点赞 评论 到底啦
<section>
is also an element also<section id="para1">
assigns it an id The CSS rule below will be applied to the HTML element withid="para1"
:In this example only
<p> elements with class="center"
will be center-aligned:In this example all HTML elements with
class="center"
will be red and center-aligned:如果您还有其他疑问,请在评论中注明。或者,如果您需要更多帮助,请使用一些代码扩展您的问题,以便我检查。