码迷,mamicode.com
首页 > 其他好文 > 详细

Front-End Interview

时间:2015-05-25 09:43:10      阅读:134      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!