<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <Title>Title</title> <style> .my-font-size{ font-size: 28px; }</style></head><body> <div>碼海無際</div> <div class="my-font-size">碼海無際</div></body></html>
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <style> .my-font-family{ /*font-family: 宋體;*/ /*font-family: SimSun;*/ /*font-family: \5B8B\4F53;*/ font-family: \5B8B\4F53,\9ED1\4F53; }</style></head><body> <div>碼海無際</div> <div class="my-font-family">碼海無際</div></body></html>
範圍值 100 ~ 900 為字體指定了加粗級别。如果一個字體内置了這些加粗級别,那麼這些數字就直接映射到預定義的級别,100 對應最細的字體變形,900 對應最粗的字體變形。數字 400 等價于 normal,而 700 等價于 bold。
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <style> .my-font-weight{ /*font-weight: bold;*/ font-weight: 700; }</style></head><body> <div>碼海無際</div> <div class="my-font-weight">碼海無際</div></body></html>
常用于設置斜體文本,該屬性有三個值:
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <style> .my-font-style{ font-style: italic; }</style></head><body> <div>碼海無際</div> <div class="my-font-style">碼海無際</div></body></html>
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <style> .my-font-one { font-style: italic; font-weight: bold; font-size: 20px; font-family: 宋體; } .my-font-two { font: italic bold 20px 宋體; } .my-font-three { font: 20px 宋體; }</style></head><body> <div>碼海無際</div> <div class="my-font-one">碼海無際</div> <div class="my-font-two">碼海無際</div> <div class="my-font-three">碼海無際</div></body></html>
,
更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!