In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is about how bootstrap automatically converts px to rem. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Conversion between the REM value in CSS3 and Px:
Bootstrap default html {font-size: 10px;}
Rem is a value of relative size relative to the root element
For example, suppose we set the font size of html to html {font-size: 87.5%;} (that is, 14px).
Then the other fonts are the values you want to divide by 14.
For example, the default twentytwelve theme size is 960px, which translates to rem as 960/14=68.57142857142857rem.
Padding's 24px is 24/14=1.714285714285714rem, and so on.
The above 14 is a variable. Relative to your setting of the html font size of the root element, if you set it to 62.5%, the divisor becomes 10. The comparison table is shown on the right:
I don't know the advantages of using this rem unit, but if the font size of your root element is 62.5%, then the conversion between px and rem is that px is directly divided by 10 to get rem, which is much simpler than em. So far, I haven't figured out how to convert em and px.
In addition, rem is not supported by other browsers except ie8 and below ie8. If you want to consider ie8 and take a look at it, you can set a px and then set a rem as the default file of twentytwelve.
Thank you for reading! This is the end of the article on "how to automatically convert px to rem from bootstrap". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.