如何组合多个 CSS 规则?

2022-01-10 00:00:00 css-selectors html css
div#id_div_allposts {   
    width: 100%;    
}

div.class_div_post {
    width: 100%;
}

div.class_div_editdelete {
    width: 100%;
}

如何写成一行?

以及选择带有id和class的html标签的方法是什么?

And what's the way to select a html tag with id and class ?

推荐答案

你所要做的就是用逗号分隔它们,例如

All you have to do is separate them with a comma e.g

div#id_div_allposts,
div.class_div_post,
div.class_div_editdelete {
    width:100%;
}

相关文章