用户登录
用户注册

分享至

如何组合多个 CSS 规则?

  • 作者: 没有猫也没有你99386891
  • 来源: 51数据库
  • 2022-10-20

问题描述

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%;
}
软件
前端设计
程序设计
Java相关