-1

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 your CSS experience to similar task.

Thank you in advance!

Sergiu Costas
  • 530
  • 4
  • 8
  • 26

2 Answers2

2

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;
    }
Anupam Basak
  • 1,503
  • 11
  • 13
0

Just make a div of what you want to center and in the css do like this:

margin:0;
Horray
  • 693
  • 10
  • 25