Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I combine multiple CSS rules?

div#id_div_allposts {   
    width: 100%;    
}

div.class_div_post {
    width: 100%;
}

div.class_div_editdelete {
    width: 100%;
}

How can i write it in one line ?

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

like image 240
shibly Avatar asked Jan 01 '26 01:01

shibly


1 Answers

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%;
}
like image 177
Ryan Potter Avatar answered Jan 02 '26 13:01

Ryan Potter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!