From daac2781c777d69dcbbcf5635736bf25b1cb1e25 Mon Sep 17 00:00:00 2001 From: jessie Date: Mon, 7 May 2018 17:32:26 +0800 Subject: [PATCH 1/2] add optimize base font size setting --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d7518f23..9ba716e1 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ A collection of tips to help take your CSS skills pro. 1. [Hide Autoplay Videos That Aren't Muted](#hide-autoplay-videos-that-arent-muted) 1. [Use `:root` for Flexible Type](#use-root-for-flexible-type) 1. [Set `font-size` on Form Elements for a Better Mobile Experience](#set-font-size-on-form-elements-for-a-better-mobile-experience) - +1. [Optimize base font size setting while using `rem` for Global Sizing](#optimize-base-font-size-setting-while-using-rem-for-global-sizing) ### Use a CSS Reset @@ -563,3 +563,9 @@ Current versions of Chrome, Firefox, Safari, Opera, Edge, and IE11. * [Русский](https://github.com/AllThingsSmitty/css-protips/tree/master/translations/ru-RU) [back to table of contents](#table-of-contents) + +### Optimize base font size setting while using `rem` for Global Sizing +For better calculation from px to rem, setting the base font size at the root( html {font-size: 62.5%}) is even better. +Since the default size of html is 16px, and 10/16 equals to 62.5%。Then 14px can be converted to 1.4rem while at the same time allowing user to change the default size. + +[back to table of contents](#table-of-contents) From 1b8405bd1326466dbd9d565f75cda51645fda99a Mon Sep 17 00:00:00 2001 From: jessie Date: Mon, 7 May 2018 17:35:29 +0800 Subject: [PATCH 2/2] format --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9ba716e1..f35d8e6a 100644 --- a/README.md +++ b/README.md @@ -565,7 +565,7 @@ Current versions of Chrome, Firefox, Safari, Opera, Edge, and IE11. [back to table of contents](#table-of-contents) ### Optimize base font size setting while using `rem` for Global Sizing -For better calculation from px to rem, setting the base font size at the root( html {font-size: 62.5%}) is even better. -Since the default size of html is 16px, and 10/16 equals to 62.5%。Then 14px can be converted to 1.4rem while at the same time allowing user to change the default size. +For better calculation from `px` to `rem`, setting the base font size at the root(`html { font-size: 62.5%; }`) is even better. +Since the default size of html is `16px`, and 10/16 equals to 62.5%。Then `14px` can be converted to `1.4rem` while at the same time allowing user to change the default size. [back to table of contents](#table-of-contents)