The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Media query doesn't center Img within Div

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #168898

    The media query that I have set for max-width: 1092 does not center the image that is within the div. I have set #imgWrapper to:width:100% text-align:center but the image still does not move to the center of the page.


    You have an media query which has the image floating left which is not getting overriden.

    @media (max-width: 1183px)
    #albumPic {
    float: left;

    Shouldn’t the media query max-width:1092px already override it? Anyways now I tried something and it works but I don’t think it supposed to. So what I did now is I put float:center and it works. But that’s not valid is it? Why does that work? Try resizing the window until you see the picture move to the center.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.