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

时间: 2024-11-03 20:59:19

Front-End Interview的相关文章

大陆释放四重大信号,对台政策明显出现转变

为了和平统一台湾,大陆方面向台湾释放的善意那是举世公认,无论从资金.技术.人才.农产品进入大陆,那都是一路绿灯,享受着超国民待遇.每年上千亿美元的巨大贸易逆差之所以能长期存在而没有引发矛盾,是大陆的容忍所致.反观台湾方面,对大陆释放的巨大善意却很不以为然,甚至还认为理所当然,把大陆当冤大头.一面赚大陆的钱不客气,一面搞台`独没商量. 与大陆全面对台湾开放形成鲜明对比的是,台湾方面对大陆投资.人才技术交流的种种限制.单就两岸服贸协议来看,大陆开放64个领域给台湾企业,而台湾却给大陆开放48个行业,

Garena interview question

Web Developer Interview Anonymous Interview Candidate in Singapore (Singapore) No Offer Neutral Experience Difficult Interview Application I applied through an employee referral. The process took 5 days. I interviewed at Garena Online (Singapore (Sin

《Cracking the Coding Interview》——第16章:线程与锁——题目5

2014-04-27 20:16 题目:假设一个类Foo有三个公有的成员方法first().second().third().请用锁的方法来控制调用行为,使得他们的执行循序总是遵从first.second.third的顺序. 解法:你应该想到了用lock的方法类阻塞,不过这里面有个概念问题使得直接用ReentrantLock不能通过编译(对于一个锁对象,不同在A线程中锁定,又在B线程中解锁,不允许这样的归属关系),可以用Semaphore来达到相同的目的.请看下面的代码. 代码: 1 // 16

《Cracking the Coding Interview》——第16章:线程与锁——题目3

2014-04-27 19:26 题目:哲学家吃饭问题,死锁问题经典模型(专门用来黑哲学家的?). 解法:死锁四条件:1. 资源互斥.2. 请求保持.3. 非抢占.4. 循环等待.所以,某砖家拿起一只筷子后如果发现没有另一只了,就必须把手里这只筷子放下,这应该是通过破坏"请求保持"原则来防止死锁产生,请求资源失败时,连自己的资源也进一步释放,然后在下一轮里继续请求,直到成功执行. 代码: 1 // This is the class for chopsticks. 2 import j

《Cracking the Coding Interview》——第16章:线程与锁——题目2

2014-04-27 19:14 题目:如何测量上下文切换的时间? 解法:首先,上下文切换是什么,一搜就知道.对于这么一个极短的时间,要测量的话,可以通过放大N倍的方法.比如:有A和B两件事,并且经常一起发生,每件只需要花几纳秒.如果你把A事件连续做几百万次,而B时间只做了几次,这样就能排除B事件对于测量的影响.如果总时间S = mA + nB.当m >> n 时,A≈S / m.下面的测量方法类似于打乒乓球,在主线程和副线程间互相传递一个令牌,这个令牌可以是变量.管道之类的用于通信的工具.与

《Cracking the Coding Interview》——第16章:线程与锁——题目1

2014-04-27 19:09 题目:线程和进程有什么区别? 解法:理论题,操作系统教材上应该有很详细的解释.我回忆了一下,写了如下几点. 代码: 1 // 16.1 What is the difference between process and thread? 2 Answer: 3 Process: 4 1. Basic element of resource allocation in the operating system. 5 2. Possesses independent

关于SP, front end director, back end director, SP

在vnx中有SPA和SPB的概念,lun挂给SPA和SPB来实现冗余. 在VMAX中没有SP的概念,只有front-end director and back-end director. 他们支持不同的协议,有fc的,iscsi的,fcoe的,取决于配置,lun挂给两个front-FA port来实现IO 冗余,lun只是一个符号,通过back-end port来与真是的disk通信. host HBA -> san -> front end director ports -> lun

Popular HashMap and ConcurrentHashMap Interview Questions

http://howtodoinjava.com/core-java/collections/popular-hashmap-and-concurrenthashmap-interview-questions/ Popular HashMap and ConcurrentHashMap Interview Questions June 14, 2013 by Lokesh Gupta In my previous post related to “How HashMap works in jav

Today's interview of C#

I think they are advanced topics. C# 1. when will you use list, when will you use hashtable. 2. when will you use Idispose. 3. Async and Await public async Task<string> DoAsync5()        {           Task<string> mytask=Task.Run<string>((

stl容器中的 .front()函数隐士转换

周末,睡了两个好觉.前天把周任务完成了,在看公司项目源码.发现std::map 的.front函数会发生隐士转换. 伪代码如下: std::map<int,int> m_map; int &i = m_map.front(): // .fornt 函数书上写的是返回一个引用. m_map.pop_push(); //弹出第一个 映射 return i; //当时就郁闷了,这样做不会出错吗? //仔细看是这样的 int i = m_map.front(); //这里转换了,当时蒙蒙冲的,