0

I am trying to get round images in both chrome and mozilla with position fixed but it somehow fails in chrome.

Here is my css :-

.circular{

    -webkit-border-radius: 150px;
    -moz-border-radius: 150px;
    border-radius: 150px;
    box-shadow: 0 3px 2px rgba(0, 0, 0, 0.3);
    border: 5px solid white;
    overflow: hidden;
    position: fixed;
    height: 100px;
    width: 100px;
    left: 80px;
    top: 20px;
}

Here is my html :-

 <div class='circular'>
              <div class='round-image'>
                <img alt="Portfolio_page" src="/assets/portfolio_page.png" />
              </div>
            </div>

This is the two result in chrome and mozilla :- mozilla view chrome view

It was appearing properly till I did not put position: fixed and give a specific height and width

Dev R
  • 1,842
  • 1
  • 25
  • 36

1 Answers1

1

try adding:

.circular img {
    position: static;
}

if that doesn't work:

.circular{
    -webkit-transform: translateZ(0);
}

i noticed that i could get the same problem if the img was position: fixed. maybe it's somehow inheriting position on the windows version of chrome. the transform can force a repaint which might also fix it

credit for the transform idea: Chrome rendering issue. Fixed position anchor with UL in body

Community
  • 1
  • 1
Sterling Camden
  • 278
  • 2
  • 7