简体   繁体   中英

SVG breaks into next line in IE11

My problem is that SVGs inside an a-tag with text in IE11 are breaking into the next line despite of me adding "display: inline" to the SVG.

Also adding "display: flex" on the a-tag is not working correctly either - just breakes the text weirdly

HTML:

 .m-stage-content { max-width: 420px; position: absolute; bottom: 2rem; -webkit-box-shadow: 0 4px 6px rgb(0 0 0 / 15%); box-shadow: 0 4px 6px rgb(0 0 0 / 15%); }.m-stage-txt { border-radius: 4px; padding: 1.5rem; }.m-stage.-whitebg { background: rgba(255,255,255,.9); }.c-btn-primary { background: #238900; text-align: center; font-size: .9999rem; font-weight: 300; padding: .625rem.75rem; line-height: 20px; border: 1px solid #238900; border-radius: 4px; color: #fff; }.m-stage-btn { display: inline-block; }.m-stage-btn svg { height: 12px; vertical-align: baseline; margin: 0 0 0.5rem; }.c-btn-primary-icon { fill: #fff; }
 <div class="m-stage-content -left"> <div class="m-stage-txt -whitebg"> <h1 class="m-stage-headline">Headline</h1> <span class="m-stage-description"><h3 style="margin: 0px; padding: 0px; border: 0px currentColor; border-image: none; line-height: 34px; vertical-align: baseline; font-stretch: inherit; font-variant-numeric: inherit; font-variant-east-asian: inherit;">Subline<br></h3></span> <a class="m-stage-btn c-btn-primary" href="/more"> More information <svg xmlns="http://www.w3.org/2000/svg" class="c-btn-primary-icon" fill="none" viewBox="0 0 8 16"> <path d="M 0.547594 1.13915 L 0.326625 1.36009 C 0.180188 1.50652 0.180188 1.74396 0.326625 1.89043 L 6.43578 7.99962 L 0.326625 14.1088 C 0.180188 14.2552 0.180188 14.4927 0.326625 14.6391 L 0.547594 14.8601 C 0.694031 15.0065 0.931469 15.0065 1.07791 14.8601 L 7.67325 8.26477 C 7.81969 8.11834 7.81969 7.8809 7.67325 7.73443 L 1.07791 1.13915 C 0.931469 0.99268 0.694031 0.99268 0.547594 1.13915 Z" /> </svg> </a> </div> </div>

This is how it's displayed in IE11:

截图 IE11

This is how it's displayed in Chrome and should be displayed:

屏幕截图 Chrome

Does anyone know this issue and can help me?

Did you tried adding your height and width to your xml, ie needs this otherwise it handles it as fullwidth. It should look like this then:

        <svg xmlns="http://www.w3.org/2000/svg" height="80" width="80"  class="c-btn-primary-icon" fill="none" viewBox="0 0 8 16">
           <path d="M 0.547594 1.13915 L 0.326625 1.36009 C 0.180188 1.50652 0.180188 1.74396 0.326625 1.89043 L 6.43578 7.99962 L 0.326625 14.1088 C 0.180188 14.2552 0.180188 14.4927 0.326625 14.6391 L 0.547594 14.8601 C 0.694031 15.0065 0.931469 15.0065 1.07791 14.8601 L 7.67325 8.26477 C 7.81969 8.11834 7.81969 7.8809 7.67325 7.73443 L 1.07791 1.13915 C 0.931469 0.99268 0.694031 0.99268 0.547594 1.13915 Z" />
        </svg>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM