提交 a332ecc5 编写于 作者: W wanganxp

补充css的0.5px示例

上级 f343bbce
<template> <template>
<scroll-view class="page"> <scroll-view class="page">
<view class="trace"> <view class="trace">
<view class="base reserve"> <view class="base reserve">
<text class="reserve-text">scaleX(0.6)</text> <text class="reserve-text">scaleX(0.6)</text>
<text class="reserve-text">转变前位置</text> <text class="reserve-text">转变前位置</text>
</view> </view>
<view class="base reserve"> <view class="base reserve">
<text class="reserve-text">scaleY(0.8)</text> <text class="reserve-text">scaleY(0.8)</text>
<text class="reserve-text">转变前位置</text> <text class="reserve-text">转变前位置</text>
</view> </view>
<view class="base reserve"> <view class="base reserve">
<text class="reserve-text">scale(0.8,0.8)</text> <text class="reserve-text">scale(0.8,0.8)</text>
<text class="reserve-text">转变前位置</text> <text class="reserve-text">转变前位置</text>
</view> </view>
</view> </view>
<view class="base transform" style="transform: scaleX(0.6)"> <view class="base transform" style="transform: scaleX(0.6)">
<text>scaleX(0.6)</text> <text>scaleX(0.6)</text>
<text>转变后位置</text> <text>转变后位置</text>
</view> </view>
<view class="base transform" style="transform: scaleY(0.6)"> <view class="base transform" style="transform: scaleY(0.6)">
<text>scaleY(0.6)</text> <text>scaleY(0.6)</text>
<text>转变后位置</text> <text>转变后位置</text>
</view> </view>
<view class="base transform" style="transform: scale(1.2,1.2)"> <view class="base transform" style="transform: scale(1.2,1.2)">
<text>scale(1.2,1.2)</text> <text>scale(1.2,1.2)</text>
<text>转变后位置</text> <text>转变后位置</text>
</view> </view>
</scroll-view>
<view class="base">
<text>通过scaleY(0.5)实现0.5px的线</text>
<view style="width: 150px; height: 1px; background-color: #000; transform: scaleY(0.5)"></view>
<!-- <view style="width: 750px; height: 1px; background-color: #ff0000; "></view> -->
</view>
</scroll-view>
</template> </template>
<script lang="uts"> <script lang="uts">
export default { export default {
data() { data() {
return { return {
} }
}, },
methods: { methods: {
}, },
} }
</script> </script>
<style> <style>
.page { .page {
flex: 1; flex: 1;
align-items: center; align-items: center;
} }
.trace {
position: absolute; .trace {
top: 0px; position: absolute;
left: 0px; top: 0px;
width: 100%; left: 0px;
align-items: center; width: 100%;
} align-items: center;
.base { }
margin: 10px;
width: 150px; .base {
height: 150px; margin: 10px;
align-items: center; width: 150px;
justify-content: center; height: 150px;
} align-items: center;
.reserve { justify-content: center;
border: 1px dotted #588; }
background-color: #DDD;
} .reserve {
.reserve-text { border: 1px dotted #588;
color: #CCC; background-color: #DDD;
} }
.transform {
border: 1px solid #00F; .reserve-text {
background-color: rgba(0,255,255,0.5); color: #CCC;
} }
.transform {
border: 1px solid #00F;
background-color: rgba(0, 255, 255, 0.5);
}
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册