I have been sitting for 2 hours I can not put a block in the center in the diva of the slider. The problem is that I have already tried everything. It centers only when the defined width of the type is 80%. And I need the text that takes up such a width. enter image description here

Here is a site who wants to build up http://afisha.net.ru/ in the developer panel. Here is the code:

<div class="relative zoom-blurb"><div class="absolute white z1 top-0 bottom-0 right-0 left-0 mx-auto" style="width:80%;height: 40%; margin:auto; "> <p class="h1 mb1"><?php echo $data['title'] ?></p> <p class=" mt0 mb0 xs-hide">Категория: <?php echo $data['category'] ?> Опубликовано <?php echo showDate($data['datetime']) ?></p> <p class="h3 mt1 xs-hide"><?php echo $data['slogan'] ?></p> </div><a href="fullpost/<?php echo $data['id'] ?> "><img src="<?php echo $data['image']; ?>" alt=""></a></div> 

    1 answer 1

    enter image description here Did you understand correctly that you were seeking this effect? only on this slide or in general at all?

    • yes this effect. Well, for each alignment stood? How did you do that? - Lyuba Ivanova
    • added a photo with changes in the developer panel - D3f01T
    • with other slides I didn’t watch how is displayed - D3f01T
    • And one is enough for me! THX. And this is a little something that is not necessary. :) Div takes 80%, with others not a ride. :( - Lyuba Ivanova
    • one
      look in the direction of the flexbox, with their help positioning elements in the center of the block, it becomes easier - Evgeny Nikolaev