0

I have the following css which in chrome, firstfox and Edge centers an absolutely positioned image

<div runat="server" id="Logo" class="MasImg">&nbsp;</div>

.MasImg {
 position: absolute;
    top: -25px;
    width: 100px;
    height: 60px;
    background-image: url('../images/pm_image.png');
    background-position-x: center;
}

However in internet explorer 11 this doesn't center the image. Instead the image stays on the right side of the container div. My question is, how can I make my script above work in ie11?

4
  • is it the div or the background image that is on the right in ie? could you create a minimal reproducible example as with the current code, it is unclear what your issue is
    – Pete
    Commented Jul 19, 2021 at 15:26
  • @Pete I am adding my div here
    – vim
    Commented Jul 19, 2021 at 15:36
  • @Pete I have added my DIV in my question
    – vim
    Commented Jul 19, 2021 at 15:44
  • 1
    I made a sample to test but it has the same result in IE and Edge. The result is like this: i.sstatic.net/egMoz.png. Could you please provide a code snippet which can reproduce the issue? I think there might be some parts missing in your code which leads to the issue can't be reproduced.
    – Yu Zhou
    Commented Jul 20, 2021 at 8:06

0