E
E
Emil Valeev2015-10-28 13:52:24
css
Emil Valeev, 2015-10-28 13:52:24

How to correctly calculate padding and margin height in fluid layouts?

To calculate the width and height, I use the well-known formula: "context / target = result", but what about padding-margin heights if they are calculated from the width? I want to avoid magic numbers and have formula functions at hand. Thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
swcalc, 2015-10-28
@swcalc

Perhaps a simple CSS solution will help you - box-sizing:border-box;

P
Pavel Torbeev, 2015-10-28
@glizer

Calc() can also help in some cases .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question