-
文本和文字样式设置
设置文本或字体的属性需要使用到wxss,与css有所不同。我们利用class和style来进行设置。
text-decoration: overline;
/*下划线underline */
text-decoration-color: chartreuse;
/*下划线颜色*/
line-height: 30px;
/*行间距*/
white-space: normal;
/*空白符的设置*/
text-align: center;
/*对齐方式 justify 两端对齐*/
color: chartreuse;
/* 也可以直接写以#开头的十六进制 */
letter-spacing:10px;
/* 汉字字符间距 英文字符间距换成word*/
text-indent:50px;
/* 首行缩进 */
text-transform: uppercase;
/* 英文字母全部转为大写 */
white-space: nowrap;
/* 空白符,保留原有,表示文本中的空白处 */
font-style: italic;
/* 字体倾斜 */
font-weight: bold;
/* 字体加粗er更粗 */
-
图像和声音设置示例
<!--index.wxml-->
<view class='box'>
<view class='title'>图片和声音</view>
<view style='text-align:center;'>
<image src='{
{imgSrc}}' bindtap='tapCat&