css怎么改才可以让打开没有间距

css怎么改才可以让打开没有间距?是覆盖在上面的



        <view class="letter" v-if="!showDiv">
            <view class="border-b">开启私信view>
            <view>关闭私信view>
        view>


.letter{
        width: 160px;
        background-color: white;
        box-shadow: 0 0 5px 1px rgb(0 0 0 / 10%);
        z-index: 2;
        float: right;
        text-align: center;
    }
    .letter view{
        height: 42px;
        line-height: 42px;
    }

img

img

把letter设置为绝对定位或者使用float:

.letter{
        width: 160px;
        background-color: white;
        box-shadow: 0 0 5px 1px rgb(0 0 0 / 10%);
        z-index: 2;
        float: right;
        text-align: center;
        position: absolute;
    }
    .letter view{
        height: 42px;
        line-height: 42px;
}

letter 类选择器中添加 margin 属性,将其设为 0,这样就可以去掉类中的间距

你这是用的什么框架啊,uniapp还是别的什么,我感觉像这种右上角的省略号肯定有相应的组件啊,可以仔细看看官方文档