Link Search Menu Expand Document

Markdown Note

1. Text style

Use font, e.g.:

<font color=red size=16> Hello World </font>

Output: Hello World

Use span style, e.g.:

<span style=" background-color: green; color:white; font-weight:800; font-size:25px; font-style: italic">Hello World</span>

Output: Hello World


1.1 Font-size Unit

em and % are relative length units, while px (pixle) and pt (point) are absolute length units . For example:

<div style="font-size:14px;">
  <span style="font-size: 1em;">1em; </span>
  <span style="font-size: 100%;">100%; </span>
  <span style="font-size: 14px;">14px; </span>
  <span style="font-size: 14pt;">14pt; </span>
  <font size=5> 5; </font>
  <font size=4> 4; </font>
  <font size=3> 3; </font>
  <font size=2> 2; </font>
  <font size=1> 1. </font>
</div>

Outputs:

1em; 100%; 14px; 14pt; 5; 4; 3; 2; 1.

Reference:

新手必备知识 | font-size 的常用长度单位用哪个才好?