【问题标题】:SCSS images distortedSCSS 图像失真
【发布时间】:2016-08-17 06:05:07
【问题描述】:

我有一个在浏览器中显示为圆形的圆形图像。但是,当我构建 apk 并在我的 android 手机上运行它时,图像会失真(宽度大于高度)。我如何强制它保持圆形?

我正在使用 Ionic 2

HTML:

<p class="item-selected-row search-right">
    <img class="item-stable" id="icon-image-{{subcategory.id}}" src="{{subcategory.icon}}" height="23" width="23" />
</p>

SCSS:

.item-selected-row {
    display: inline-flex;
}

.search-right {
    float: right;
}

img.item-stable {

}

【问题讨论】:

    标签: html css ionic-framework sass scss-lint


    【解决方案1】:

    您可以明确设置widthheight,例如:

    img.item-stable {
      width: 50%;
      height: 50%;
    }
    

    【讨论】:

    • 谢谢安德烈亚斯。我会尝试在css中设置它。不过,我认为它已经在 html 中发送,这不会有什么不同。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多