-
em和rem的区别?
rem 和 em 单位是由浏览器基于你的设计中的字体大小计算得到的像素值。 em 单位基于使用他们的元素的字体大小。 rem 单位基于 html 元素的字体大小。 em 单位可能受任何继承的父元素字体大小影响 rem 单位可以从浏览器字体设置中继承字体大小。 使用 em 单位应根据组件的字体大小而不是根元素的字体大小。 在不需要使用em单位,并且需要根据浏览器的字体大小设置缩放的情况下使用rem。 使用rem单位,除非你确定你需要 em 单位,包括对字体大小。 媒体查询中使用 rem 单位 不要在多列布局中使用 em 或 rem ,改用%。 不要使用 em 或 rem,如果缩放会不可避免地导致要打破布局元素。 [原文](http://www.w3cplus.com/css/when-to-use-em-vs-rem.html)
fe-interview's Introduction
fe-interview's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.