Home › Forums › CSS › RWD: struggle with flexible padding context › Reply To: RWD: struggle with flexible padding context
May 25, 2014 at 11:26 am
#171050
Ramone
Participant
+1 for box-sizing: border-box
, but this is not the issue here.
The uncertainty with padding context persists.
Following the book, left margin is calculated relatively to the blue box’s parent – red div, whereas left padding of the blue box is calculated relatively to the box’s width.
As seen, margin seems to be calculated correctly – it accomodates 10% of the red div’s width. As for padding, it must accomodate 10% of the blue box’s width, but it doesn’t. Rather, it looks like it equals left margin.
This is the behaviour I don’t get.