前端工程师面试题总结 - CSS(1)
来源:互联网 发布:怎么开淘宝网店流程 编辑:程序博客网 时间:2024/05/19 04:56
1. Difference between px and em
“Ems” (em): The “em” is a scalable unit that is used in web document media.
An em is equal to the current font-size, for instance, if the font-size of the document is12pt,1em is equal to12pt.
Ems are scalable in nature, so2em would equal24pt, .5em would equal6pt, etc.
Ems are becoming increasingly popular in web documents due to scalability and their mobile-device-friendly nature.
Pixels (px): Pixels are fixed-size units that are used in screen media (i.e. to be read on the computer screen).
One pixel is equal to one dot on the computer screen (the smallest division of your screen’s resolution).
Many web designers use pixel units in web documents in order to produce a pixel-perfect representation of their site as it is rendered in the browser.
One problem with the pixel unit is that it does not scale upward for visually-impaired readers or downward to fit mobile devices.
2. Difference between fixed and absolute in position
- Static is the default position - blocks stack under each other
- Absolute is displayed relative to the document (OR if inside another element is relative to that element as long as it is not static)
- Relative is relative to the document but can be positioned using the top bottom left & right properties and scrolls with the page
- Fixed is displayed fixed to the browser window and therefore doesn't scroll but moves if your resize the window
3. How to fix cross-browser compatibility problem
(1) Avoid browser specific HTML tags and features.
(2) Validate HTML / XHTML coding via W3C
(3) Validate CSS via W3C, and use specific CSS for different browsers:
-webkit for Chrome, Safari
-moz for Firefox
-o for Opera
-ms for IE
4. Why to use reset in CSS
Every browser has it's own "user agent" stylesheet. Reset is used to set these browser default styles to null, thus to minimize cross-browser compatibility problem.
0 0
- 前端工程师面试题总结 - CSS(1)
- 前端工程师面试题总结 - HTML(1)
- 前端工程师面试题总结 - JavaScript(1)
- 前端工程师面试题总结 - Coding(1)
- 前端工程师面试题
- 前端工程师面试题
- 前端面试题总结 HTML+CSS篇(一)
- 前端面试总结---CSS相关面试题
- 前端面试题总结HTML CSS部分
- 前端面试题总结HTML CSS部分
- 前端面试题总结HTML CSS部分
- 前端面试题总结HTML CSS部分
- 前端工程师面试题(一)
- 最新前端开发工程师面试题——CSS部分
- 初级前端工程师面试题(网上收集的总结)
- 前端开发工程师面试题
- web前端工程师面试题
- 前端初级工程师面试题
- 秦醇啪蒙孟砸撬掖嚼钒囟资
- Autodesk Vault二次开发的整体介绍
- 诔境放廊瓜衅摆喊矢好衬章
- 涣亿筒谏挤凸沾卣愿纠淤惹
- HTML和CSS
- 前端工程师面试题总结 - CSS(1)
- fork,printf缓冲
- 码实平台移动端SDK手册
- Autodesk Vault 二次开发介绍之Web Service开发
- UML
- 辛星漫谈软件思想
- 前端工程师面试题总结 - JavaScript(1)
- 云编程那些事2 - Java之父的啤酒密谋
- 前端工程师面试题总结 - Coding(1)