Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS RWD: struggle with flexible padding context Reply To: RWD: struggle with flexible padding context

#171058
Atelierbram
Participant

You might be on to something here, but I wouldn’t get hung up on it. He’s basically explaining in this abstracted way the converting of set pixels to percentages on elements. It’s about this converting calculation thing, is his example he is converting the 48px padding on this h1.lede-element into percentages on the Robot-or-Not demo site . Here he gets away with it, because the width of the h1.lede element is the same as the width of the parent, since as he writes ‘the headline doesn’t has a declared width’ – (and also no margin set): so defaults to 100% on block-elements.

Tweeted this out:
Wouldn’t it be great if @beep could comment on this forum question https://css-tricks.com/forums/topic/rwd-struggle-with-flexible-padding-context/ … on the 4 year anniversary of his 1st @RWD article?

Got an answer from him back right away: incredible:

Saying “That is, the context for padding + margin is the same as width: the width of the element’s container. (http://www.w3.org/TR/css3-box/#padding1 …)”

and: “I don’t have an account, but that’s an error in the book. (One that’s soon going to be corrected.)”

So @Ramone kudos for finding this error, confirmed by the writer himself!