1

How can i add my margins and paddings to my height and width without changing the %

example:

height: 100%;
width : 100%;
margin-left:10px;

how can the margin be included in the calculation of width and height?

border-box?

Raja
  • 305
  • 2
  • 15

2 Answers2

0

You may include padding and borders in the width/height but not margins. Margins are the area outside the element and thus the element can not claim the ownership of margins.

King Size
  • 397
  • 1
  • 6
0

You can't use margin or paddings without some width or height, you must have some content inside your tag. If you can't change css just give some min-height/min-width in px or give a content. Here is an [example][1]

[1]: http://codepen.io/ostinred/pen/jPQBRW
ostinred
  • 116
  • 7