admin管理员组文章数量:1200394
I am trying to make the Meteogram Weather Widget from yr.no responsive and align it in the centre of a div. The widget embed is an SVG. The developer's docs say to include the embed in an iframe, which I have done.
I am using Bootstrap 5, so have tried the mx-auto class to centre the widget, but that hasn't worked. I have also tried centring by using the flex classes (d-flex justify-content-center), which hasn't worked either. The widget stays left aligned regardless of the options I have used and is not behaving responsively.
HTML
<div class="weather-embed mx-auto">
<iframe class="weather-embed-iframe" src=".svg" frameborder="0" scrolling="no"></iframe>
</div>
SCSS
.weather-embed {
position: relative;
overflow: hidden;
width: 100%;
padding-top: 56.25%;
&-iframe {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
}
}
本文标签:
版权声明:本文标题:css - How can I adjust the positioning of the yr.no SVG Meteogram Weather Widget and make it responsive? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738559053a2098868.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论