Last active
April 26, 2021 14:38
-
-
Save terrychan999/ab363f00ce7f3f2a7ec03d95d7df2ad4 to your computer and use it in GitHub Desktop.
CSS font size using relative unit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
font-size: 16px; | |
} | |
html * { | |
font-size: 1rem; | |
} | |
h1 { | |
font-size: 2rem; | |
} | |
h2 { | |
font-size: 1.5rem; | |
} | |
h3 { | |
font-size: 1.17rem; | |
} | |
h4 { | |
font-size: 1rem; | |
} | |
h5 { | |
font-size: .83rem; | |
} | |
h6 { | |
font-size: .67rem; | |
} | |
h1, | |
h2, | |
h3, | |
h4, | |
h5, | |
h6 { | |
margin: 0; | |
} | |
/*for screen size like iPhone5*/ | |
@media only screen and (max-width: 350px) { | |
html { | |
font-size: 14px; | |
} | |
} | |
/*涵蓋大部分系統之中文黑體*/ | |
html, | |
body { | |
font-family: 'Noto Sans CJK TC', 'PingFang', 'Microsoft JhengHei', sans-serif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment