上大学网 > 招聘笔试题 > 正文

腾讯WEB前端笔试题和面试题答案(二)

更新时间:上大学网

四、用心想一想,你一定是生活中的智者! (每题9分,共36分)

  1. 写出ul、ol、dl三种列表的html结构。

  答:

  复制代码

  2. 将以下CSS代码进行缩写,注意要符合缩写的规范。

  a) 代码一:

  border-width:1px;

  border-color:#000;

  border-style:solid;

  复制代码

  b) 代码二:

  background-position:0 0;

  background-repeat:no-repeat;

  background-attachment:fixed;

  background-color:#f00;

  background-image:url(background.gif);

  复制代码

  c)代码三:

  font-style:italic;

  font-family:”Lucida Grande”,sans-serif;

  font-size:1em;

  font-weight:bold;

  font-variant:small-caps;

  line-height:140%;

  复制代码

  d) 代码四:

  list-style-position:inside;

  list-style-type:square;

  list-style-image:url(image.gif);

  复制代码

  e)代码五:

  margin-left:20px;

  margin-right:20px;

  margin-bottom:5px;

  margin-top:20px;

  复制代码

  f)代码六:

  color:#336699;

  color:#ffcc00;

  复制代码

  答:

  代码一:border:1px #000 solid;

  代码二:background: #f00 url(background.gif) no-repeat fixed 0 0;

  代码三:font:italic bold small-caps 1em/140% “lucida Grande”,sans-serif;

  代码四:list-style: url(image.gif) square inside;

  代码五:margin:20px 20px 5px 20px;

  代码六:color:#369;color:#fc0;

  复制代码

  3. 修改以下代码,使其结构更加合理以及符合W3C标准。(XHTML 1.0 Strict)

  代码:

  Don’t buy these electronics used

  Money may be tight, but you may kick

  yourself for purchasing these electronics secondhand.

  Even when the price is low,

  the risk may be too high.

  target=”_blank”>home content

  复制代码

  答:

  Don’t buy these electronics used

  Money may be tight, but you may

  kick yourself for purchasing these electronics secondhand.

  Even when the price is

  low, the risk may be too high.

  href=”home.html” rel=”external” title=”home”>home

  rel=”external” title=”content”>content

  复制代码

  4. 简述border:none以及border:0的区别,并给出使用建议。

  答:border:none表示边框样式无,border:0表示边框宽度为0;当定义了border:none,即隐藏了边框的显

  示,实际就是边框宽度为0.

  当定义边框时,必须定义边框的显示样式.因为边框默认样式为不显示none,所以仅设置边框宽度,由于样

  式不存在,边框的宽度也自动被设置为0.

五、勇气拼一拼,让你超越别人的加分题目来了! (不限于一种方法,共30分)

  使用重构的方式制作出一个如下图的水平、垂直都居中短边为50px,长边为150px的红色十字架。

中国点击率最高的一篇文章 !