Search code examples
htmlcssimagealignmentcenter

centering images with next to each other in html


I have 3 images which is i want all the images to be center of the page after my horizontal line

here is the code

<div class="footer">
    <hr>
    <p id="socmed">Connect Socially With Us:</p>
    <img id="fb" border="0" src="image/fb.png" alt="Facebook Fan Page" align="center">
    <img id="twitter" border="0" src="image/twitter.png" alt="Facebook Fan Page" align="center">
    <img id="youtube" border="0" src="image/youtube.png" alt="Facebook Fan Page" align="center">
    <hr>
</div>

hr{
    border: 0;
    height: 5px;
    background-image: -webkit-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0)); 
    background-image:    -moz-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0)); 
    background-image:     -ms-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0)); 
    background-image:      -o-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0)); 
}

i'm trying to use align function but it does not give any effect

is there a way to align these 3 images to be centered and next to each other?

thank you


Solution

  • Give `text-align:center" CSS styling to your footer.

     .footer{text-align:center;}