Front-End Interview

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).

转载于:https://www.cnblogs.com/glee/p/4527047.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值