微信小程式 wxml wxss中使用的css 中的style樣式
阿新 • • 發佈:2019-01-29
微信小程式中使用的佈局還有樣式,使用到的是前端的 css
屬性
width: fit-content;
font-size:20px; /*設定文字字號*/
color:red; /*設定文字顏色*/
font-weight:bold; /*設定字型加粗*/
border:1px solid red;/*新增邊框樣式(粗細為1px, 顏色為紅色的實線)*/
font-family:"宋體"; /*設定字型為宋體*/
font-style:italic; /*文字排版--斜體*/
text-decoration:underline; /*文字排版--下劃線*/
text-decoration:line-through;/*文字排版--刪除線*/
text-indent:2em; /*段落排版--縮排*/
line-height:1.5em; /*段落排版--行間距(行高)*/
letter-spacing:50px; /*段落排版--中文字間距*/
word-spacing:50px; /*字母間距*/
text-align:center; right ; left ; /*段落排版--對齊*/
display:inline-flex; /*將物件作為內聯塊級彈性伸縮盒顯示*/
display:block; /*設定為塊狀元素*/
display:inline; /*設定為內聯元素*/
display:inline-block; /*設定為內聯塊狀元素*/
word-break:keep-all; /* 不換行 */
white-space:nowrap; /* 不換行 */
vertical-align:middle; /*把此元素放置在父元素的中部。*/
border-style(邊框樣式)常見樣式有: (border-color,border-width) 邊框相關設定
dashed(虛線)| dotted(點線)| solid(實線)。
border-bottom border-top border-right border-left 上下左右線單獨設定
box-sizing: border-box; //當使用padding的時候不影響大小
padding-top padding-right padding-bottom padding-left
margin-top margin-right margin-bottom margin-left (margin:10px 10px 10px 10px; top、right、bottom、left)