weex 两个 relative

2019-09-26 17:51:29 阅读:4 编辑
<template>
    <div class="wapper">
        <div class="div">
            <image class="image" src="https://s.zhyxm.com/uploads/images/6bbd146e95e4624dbda8b27dfd50f7e9.png" style="width: 200px;height: 180px"></image>
            <text class="text">hello</text>
            <div class="div2">
                <text class="text2">hello2</text>
            </div>
        </div>
    </div>
</template>
<script>
    export default {data:function () {return {}
        }
    }
</script>
<style scoped>
    .wapper {
        width: 750px;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        display: flex;
    }
    .div {position: relative;}
    .div2{
        position: relative;
        background-color: red;
        width: 100px;
        height: 100px;
    }
    .text{
        position: absolute;
        left: 0;
        top: 0;
    }
    .text2{
        position: absolute;
        left: 0;
        top: 50 px;
    }
</style>