1、CSS position 有哪些取值?
答:sticky absolute fixed relative static
2、span{font-size: 14px;} 对应 span 里的文字大小一定是 14px
答:错误
原因:

由图可知,当font-size为100px时,字的高度却不是100px.而且还会根据中英文的不同,或者字体的不同,同为设置100px的字,真正量出来的都不一样。
并且,看图中span的红色的边框明显的和字有一定距离,这也就是指的是下图红色部分的建议行高:

3、Chrome 中默认的 line-height 为 1.2
答:错误
原因:

再由上图可知,真正的行高差不多为140,所以,Chrome 中正常的字体默认的 line-height 为 1.4倍左右。
一旦字体变化,默认的lineheight就又会改变,如下图:

4、CSS 中 width 的默认值是多少?
答: auto
5、HTML 结构为 div.parent > div.child 如果 div.parent 的样式为 width: 1000px; padding: 100px; 那么请问 div.child 所占的宽度为多少 px ?
答:1000px.
原因:


6、content-box 与 border-box 的区别是?
答:
content-box 的 width 不包括 padding 和 border
border-box 的 width 包括 padding 和 border
原因:
7、
<span>1</span>
<span>2</span>
请问页面中, 1 和 2 之间有什么?
答:有一个空格
原因:

8、

网友评论