Search code examples
imageresponsiveamp-html

Image stop being responsive as a child of a <a> element


I am trying to make the logo to redirect to the homepage, but when I put the image in an anchor its responsiveness doesn't work. I am using the "Simple Blog" template from here https://www.ampstart.com/templates

<a href="/">
  <amp-img src="/images/logo/logo.svg" width="435" height="61.3" layout="fixed" class="my0 mx-auto " alt="Logo"></amp-img>
</a>

Solution

  • Try changing the layout type of amp-img from fixed to responsive.

    I seem to recall possibly having some issues with SVG and responsive, but I could be thinking of something else. If responsive doesn't work try intrinsic.

    See the tips and tricks section of the amp-img page for more info.