0

I have an element which looks weird in mobile, it is not totally center as I need it,so I want to know if there is any kind of standard in order to center things in any resolution.

Look:

<li> 
   <div class="asoc-director">                                     
        <a href="javascript:void(0)" class="client-director">
            <img class="card-picture-admins" src="assets/images/team/my-img.png">
            <span class="name-role" id="37">Sigfried Bermudez <br> Associate Director</span>
        </a>           
    </div>
</li>

and the css for is:

.asoc-director {
    padding-top: 46px;
    width: 100%;
    height: 140px;
}

li > div a:first-child {
    left: 35%;
    z-index: 2;
}
1

1 Answer 1

3

There is. It's called flexbox, which is is a property of display. Use display: flex on the container in conjunction with align-content: center and justify-content: center to center the children.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.