本文主要是介绍uniapp的/绝对定位/相对定位/固定定位/粘滞定位,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
【[html5]你还分不清楚绝对定位和相对定位......】
相对定位一般配合绝对定位使用
<template><view class="content"><view style="background-color: black;width: 100%;height: 300px;position:relative;"><view class="one">1</view></view><view style="background-color:antiquewhite;width: 100%;height: 1000px;position:relative;"></view></view>
</template>
<script>export default {data() {return {}},onReady(res) {},created() {},methods: {}}
</script>
<style>.one{width: 100px;height: 100px;background: #0ff;position: sticky;left: 100px;top:100px;}
</style>
这篇关于uniapp的/绝对定位/相对定位/固定定位/粘滞定位的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!