mobile webiste 中的css的font-size em及line-height等换算
来源:互联网 发布:学生成绩管理系统c语言 编辑:程序博客网 时间:2024/05/21 14:51
在mobile web设计 中,我们常常需要使用em这个字体大小的单位。em到底是多少呢?
em到底应该设置为多少个em呢?通常换算成方法是1em=target fontsize we want/fontsize of containing element ,比如我们设置html tag的font-size为默认的16px, 为了换算方便,我们把body的font-size设置为10px,也就是说browser的默认font-size为10px,对于body来说,其context就为html的font-size(16px),因此body{font-size: 62.5%;/*1em=10px作为基线*/}h1希望设置为30px,则h1的em值应该设置为30px/10px=3em
当在一个element上设置flexible margin时,context是元素的container的width
当在一个element上设置flexible padding时,context是元素本身的width!
fluid site: Fluid grid, Relative values(percentages);
对于line-height属性我们也可以设置为em和300%的百分比或者直接为3的数字,这个百分比和数字的区别在于300%要先根据font-size计算后再继承进line-height中,而3这个数字则直接从font-size中继承
阅读全文
0 0
- mobile webiste 中的css的font-size em及line-height等换算
- CSS Font-Size: em、px 、pt 、Percent之间的关系及换算
- CSS Font-Size: em、px 、pt 、Percent之间的关系及换算
- css中font的简写方法(包括font-weight,font-size,line-height,font-family)
- 关于line-height,font-size等
- font-size 和 line-height 的含义
- font-size,line-height,text-indent大小的设置方法(px,em,百分数)及其继承性
- 关于line-height行高 与 font-size 的讲解
- CSS font-size: em&rem
- line-height高度大于font-size
- css中font-size的单位有px、em、pt
- css中font-size的单位有px、em、pt
- CSS Font-Size: em、 px 、pt 、Percent
- CSS Font-Size: em、 px 、pt 、Percent
- CSS的单位及line-height百分比
- font-size 与line-height:14px; 小记
- 行框、行内框、行间距、line-height、font-size
- 重新认识font-size、line-height和行高
- NgModelController: $setViewValue,$render,Formatter, Parser
- ROBOTICS2015 ORB-SLAM: a Versatile and Accurate Monocular SLAM System
- angular中的scope
- 通过cat /prco/driver/rtc 看到rtc的信息
- angular attrs.$observe和$scope.$watch的区别
- mobile webiste 中的css的font-size em及line-height等换算
- 【CUGBACM15级BC第11场 B】hdu 5055 Bob and math problem
- git internal for computer scientists
- 选择Code Style及Default Pro
- angularJS web应用SEO
- phantomjs rendering
- git多账户配置
- css中attribute selector及pseudo class
- css tips: 清除float影响,containing的div跟随floated sub等