
简体中文
font-weight CSS 属性指定了字体的粗细程度。一些字体只提供 normal 和 bold 两种值。
Web | Android | iOS |
---|---|---|
4.0 | 3.9 | 4.11 |
font-weight: <font-weight-absolute>{1,2};
名称 | 兼容性 | 描述 |
---|---|---|
normal | 正常粗细。与 400 等值。 | |
bold | 加粗。与 700 等值。 | |
400 | 正常粗细,与 normal 等值。 | |
700 | 加粗,与 bold 等值。 |
normal
该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验
<template>
<view style="flex-grow: 1;">
<view style="height: 250px;background-color: gray;justify-content: center;align-items: center;">
<text class="common" style="font-weight: normal;">font-weight: normal</text>
<text class="common" style="font-weight: bold;">font-weight: bold</text>
<text class="common" style="font-weight: 400;">font-weight: 400</text>
<text class="common" style="font-weight: 700;">font-weight: 700</text>
</view>
</view>
</template>
<script>
</script>
<style>
.common {
font-size: 20px;
}
</style>