Quantcast
Channel: CSS 100% height with padding/margin - Stack Overflow
Viewing all articles
Browse latest Browse all 16

Answer by ktbiz for CSS 100% height with padding/margin

$
0
0

Another solution: You can use percentage units for margins as well as sizes. For example:

.fullWidthPlusMargin {    width: 98%;    margin: 1%;}

The main issue here is that the margins will increase/decrease slightly with the size of the parent element. Presumably the functionality you would prefer is for the margins to stay constant and the child element to grow/shrink to fill changes in spacing. So, depending on how tight you need your display to be, that could be problematic. (I'd also go for a smaller margin, like 0.3%).


Viewing all articles
Browse latest Browse all 16

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>