Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add padding to min-height instead of including it?

Is there a way to have the padding on an element be added to the min-height value instead of being included in it? For example you have 10px of padding on the top and bottom a element and a min-height of 150px the height should be 170px instead of the element's height being 130px + 20px of padding.

I'm currently building a site using Material Design Lite and it adds padding to almost everything so it's a bit of a pain to have to always find the padding on something when you want to set a min-height value.

like image 463
CJK Avatar asked Sep 07 '25 20:09

CJK


1 Answers

I might be a little late, but setting box-sizing: content-box; on the element would solve the issue.

like image 145
Mindaugas Jakubauskas Avatar answered Sep 09 '25 20:09

Mindaugas Jakubauskas