daily-share icon indicating copy to clipboard operation
daily-share copied to clipboard

图片+ 文字 如何对齐(2020-02-20)

Open yaogengzhu opened this issue 5 years ago • 1 comments

文字 + 图片对齐

对于这个需求,我之前采取的措施都是 display 布局。突然flex布局对某些效果有限制了,我哭了。。

  • 发现了其实原生css 有这个操作

图片元素

vertical-align:sub;  // 属性有很多实在对齐,自己选用

yaogengzhu avatar Feb 20 '20 08:02 yaogengzhu

补充一个css 文字两端对齐,兼容iOS端

@mixin justify_and_ios($top: 0) {
    position: relative;
    top: $top;
    display: inline-block;
    height: 100%;
    width: 100%;
    text-align: justify;
    vertical-align: top;
    &::after {
        display: inline-block;
        width: 100%;
        content: '';
        height: 0;
    }
}

.text-aligin {
    @include justify_and_ios()
}

yaogengzhu avatar Sep 01 '20 01:09 yaogengzhu