Why doesn't margene?

Hello. There is a method of alignment of multiple lines of text vertically:
#parent {display: table;}
#child {
display: table-cell;
vertical-align: middle;
}

But in this method, the child block does not apply margene.
Why?
And how to align the text not the fixed number of rows in the parent with a fixed height?
July 9th 19 at 12:54
2 answers
July 9th 19 at 12:56
Solution
A table cell can have a padding (padding), but may not have fields (margin).

You can do like this: codepen.io/anon/pen/oxrEQW
Thank you - Cornell_Ebert commented on July 9th 19 at 12:59
July 9th 19 at 12:58
Solution
Why?

Because to table cells to apply the margin doesn't make sense. The spacing between cells is set using border-spacing.

And how to align the text not the fixed number of rows in the parent with a fixed height?


By passing your method of aligning I know two.
1. Flexbox (recommend).
2. And the second better shows https://jsfiddle.net/k2qrtgbj/
Thank you - Cornell_Ebert commented on July 9th 19 at 13:01

Find more questions by tags CSSHTML