N
N
Nikita2015-11-15 02:49:37
css
Nikita, 2015-11-15 02:49:37

How to indent a container?

For example, a simple page consists of three blocks: header, main, footer. main contains container. I set the margin property for the container. Why does top padding appear between main and header and not between container and main?
https://jsfiddle.net/s0z5tv4t/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Latyshev, 2015-11-15
@nikitathegreat

margin is the outer padding, instead you need to use padding-top for the main block

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question