首页 > 其他 > 详细

Front-End Interview

时间:2015-05-25 09:42:46      阅读:188      评论:0      收藏:0      [点我收藏+]

1. what is the difference between classes and ID‘s in CSS?

A: ID‘s are unique:

      Each element can only have one ID

      Each page can only have one elemetn with that ID

    Classes are not unique:

      You can use the same class on multiple elements

      You can use multiple classes on the same elements.

  Classes are good when setting styles on a group of elements. ID‘s are good when manipulate single element.

2. What is the difference between "resetting" and "normalizing" CSS? Which would you choose, and why?

A: /*CSS reset: is a short rules that resets the styling of all HTML elements to a consistent baseline so that the default rending of HTML by different browsers couldn‘t touch.*/

Reset is to reset everything.stripping away all the default rendering.

normalizing: allowing certain elements like the headers, ordered lists, block quotes ,forms and many other simple things to be left alone.

3. Describe Floats and how they work

A: floats have four values

left

right

none: ensures the element will not float

inherit: will assume the float value from that element‘s parent element.

4. Describe z-index and how stacking context is formed.

  The z-index property in CSS controls the vertial stacking order of elements overlap. z-index only effects element that have a "position" value other than static(the default).

Front-End Interview

原文:http://www.cnblogs.com/glee/p/4527047.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!