Home html CENTRATION DIV in the center of the parent DIV

CENTRATION DIV in the center of the parent DIV

Author

Date

Category

The question is beaten, but I can not cope.
There is an external DIV with an internal dam and full width image

I can not clarify the text over the picture

& lt; div class = "one" & gt;
 & lt; div class = "two" & gt; text & lt; / div & gt;
 & lt; img class = "Full" src = "https://pp.vk.me/c630828/v630828919/5293e/hthcyfpux29.jpg" & gt;
& lt; / div & gt;

css

. one {
 Background-Color: #CCC;
}
.two {
 width: 40%;
 Height: 40%;
 margin: 0px auto;
 Text-Align: Center;
}
.full {
 width: 100%;
 Height: AUTO;
}

Answer 1, Authority 100%

Apply Absolute Positioning + Margin: Auto;

Show code


Answer 2, Authority 33%

You can via the Flex property,

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions