Sergiu Costas Sergiu Costas - 7 months ago 11
HTML Question

how to center perfectly image and text inline in the center of page

How to center perfectly both an Image and Text in the middle of container?

My task is to center in the footer side the logo and copyright text horizontally perfect. Please, share you CSS experience to similar task.

Thank you in advance!

Answer

Check this out.
Fiddle: http://jsfiddle.net/tbj3hsmL/

HTML:

<div class="footer">
    <img src="http://placehold.it/25x25" />
    <span class="text">Footer Text</span>
</div>

CSS:

.footer {
    padding: 10px;
    background: #ddd;
    text-align: center;
}
    .footer img {
        vertical-align: middle;
    }
    .footer .text {
        margin-left: 10px;
    }