首页 新闻 赞助 找找看

阿里巴巴web前端开发面试题?

0
悬赏园豆:100 [已解决问题] 解决于 2012-03-29 17:09

第一部分:用CSS实现布局

让我们一起来做一个页面
首先,我们需要一个布局。
请使用CSS控制3个div,实现如下图的布局。

第二部分:用javascript优化布局

由于我们的用户群喜欢放大看页面
于是我们给上一题的布局做一次优化。
当鼠标略过某个区块的时候,该区块会放大25%,
并且其他的区块仍然固定不动。

提示:
也许,我们其他的布局也会用到这个放大的效果哦。
可以使用任何开源代码,包括曾经你自己写的。

关键字:
javascript、封装、复用

第三部分:处理紧急情况

好了,我们的页面完成了。
于是我们将页面发布上网。
突然,晴天霹雳,页面无法访问了,这时候,你会怎么做?

草根程序猿的主页 草根程序猿 | 初学一级 | 园豆:129
提问于:2012-03-29 10:06
< >
分享
最佳答案
-1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>用CSS实现布局</title>
<style type="text/css">
body,div
{ padding:0; margin:0; font:normal normal 50px/normal Arial, "微软雅黑", "宋体";}
.contain
{ width:600px; height:500px; position:relative}
.a
{ width:200px; height:260px; position:absolute; left:0; top:0; line-height:260px}
.b
{ width:380px; height:500px; position:absolute; right:0; top:0; line-height:500px}
.c
{ width:200px; height:220px; position:absolute; left:0 ; bottom:0;line-height:220px}
.a,.b,.c
{background:#CCC; text-align:center;}
</style>
</head>

<body>
<div class="contain">
<div class="a" id="a" onmouseover="change(this)" onmouseout="reinstate(this)">a</div>
<div class="b" id="b" onmouseover="change(this)" onmouseout="reinstate(this)">b</div>
<div class="c" id="c" onmouseover="change(this)" onmouseout="reinstate(this)">c</div>
</div>
</body>
</html>
<script type="text/javascript">
function change(obj){
obj.style.width
=obj.clientWidth*1.5+"px";
if(obj.id!="b"){
obj.style.height
=obj.clientHeight*1.5+"px";
}
obj.style.background
="#f00";
obj.style.lineHeight
=obj.style.height;
obj.style.border
="2px solid #0F3";
obj.style.zIndex
=1;
}
function reinstate(obj){
obj.style.width
=obj.clientWidth/1.5+"px";
if(obj.id!="b"){
obj.style.height
=obj.clientHeight/1.5+"px";
}
obj.style.background
="#ccc";
obj.style.lineHeight
=obj.style.height;
obj.style.border
="none";
obj.style.zIndex
=0;
}
</script>

处理紧急情况

这个情况就比较多了,不知道要考什么

有可能域名不通,有可能网络不通,有可能服务器问题;看页面无法访问,报什么错,根据错误处理一步步调试了。

收获园豆:70
人 在 旅 途 | 菜鸟二级 |园豆:315 | 2012-03-29 12:00
其他回答(2)
0

第一题:用float属性即可完成。

第二题:到网上找下代码即可。

第三题:服务器原因,不关前端什么事情。

收获园豆:20
az235 | 园豆:8483 (大侠五级) | 2012-03-29 12:00
0

第三题:应该是告诉你们领导,或者你如果知道是哪个部门的问题 直接反馈给他们的负责人

收获园豆:10
fun5 | 园豆:4 (初学一级) | 2012-03-29 13:00
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册