
简体中文
border-width 属性可以设置盒子模型的边框宽度。
Web | Android | iOS |
---|---|---|
4.0 | 3.9 | 4.11 |
border-width: <line-width>{1,4};
名称 | 兼容性 | 描述 |
---|---|---|
thin | 细边线 | |
medium | 中等边线 | |
thick | 宽边线 |
medium
注意
该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验
<template>
<!-- #ifdef APP -->
<scroll-view style="flex: 1">
<!-- #endif -->
<view style="flex-grow: 1">
<view>
<text>border-width: 5px (without border-style)</text>
<view class="common" style="border-width: 5px;"></view>
</view>
<view>
<text>border-width: 5px</text>
<view class="common" style="border-width: 5px; border-style: solid;"></view>
</view>
<view>
<text>border-left-width: 5px</text>
<view class="common" style="border-left-width: 5px; border-left-style: solid; "></view>
</view>
<view>
<text>border-top-width: 10px</text>
<view class="common" style="border-top-width: 10px; border-top-style: solid; "></view>
</view>
<view>
<text>border-right-width: 15px</text>
<view class="common" style="border-right-width: 15px; border-right-style: solid; "></view>
</view>
<view>
<text>border-bottom-width: 20px</text>
<view class="common" style="border-bottom-width: 20px; border-bottom-style: solid; "></view>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<style>
.common {
width: 250px;
height: 250px;
background-color: gray;
}
</style>