发新话题
打印

2009年10月16日作业:迅雷前端面试题解答

2009年10月16日作业:迅雷前端面试题解答

就像豆猫同志说的,会不定期找一些题目给大家做的!
总共三道题:


[ 本帖最后由 unicac 于 2009-10-16 10:28 编辑 ]
附件: 您所在的用户组无法下载或查看附件
只有经历,才感觉可贵,只有坚强,才能出众!

TOP

汗。。。昨天我还说出这个题来着,哈哈哈哈
=^^=

TOP

有个错别字,已修正。。。谢谢 命若琴弦 童鞋。。。

[ 本帖最后由 unicac 于 2009-10-16 10:29 编辑 ]
只有经历,才感觉可贵,只有坚强,才能出众!

TOP

第一题太难了。。。。

只做了二 三题出来。
复制内容到剪贴板
代码:
<!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>
<style type="text/css">
* {
        margin:0;
        padding:0;
        font-size:12px;
}
body {
        position:relative;
        height:600px;
}
#content {
        margin:0 auto;
        position:absolute;
        top:50%;
}
ul {
        margin:0 400px;
}
#nav {
        list-style:none;
        position:relative;
        top:-50%;
}
#nav li {
        float:left;
        margin-left:10px;
        height:24px;
}
#nav a {
        background:url(http://www.chinacitywater.org/Jesse/images/091016left.jpg) no-repeat left top;
        text-decoration:none;
        padding-left:4px;
        float:left;
        color:#333333;
}
#nav span {
        background:url(http://www.chinacitywater.org/Jesse/images/091016right.jpg) no-repeat right top;
        float:left;
        padding:5px 5px 5px 2px;
        display:block;
        cursor:pointer;
}
#nav a:hover span,#nav a:active span {
        background-position:right bottom;
        color:#666666;
}
#nav a:hover {
        background-position:left bottom;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<div id="content">
<ul id="nav">
        <li><a href="#"><span>上一页</span></a></li>
        <li><a href="#"><span>1</span></a></li>
        <li><a href="#"><span>2</span></a></li>
        <li><a href="#"><span>33333</span></a></li>
        <li><a href="#"><span>下一页</span></a></li>
</ul>
</div>
</body>
</html>
第三题
复制内容到剪贴板
代码:
<!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>
<style type="text/css">
* {
        margin:0;
        padding:0;
}
body {
        width:800px;
        height:600px;
        margin:0 auto;
        position:relative;
}
#head {
        width:100%;
        background-color:#666666;
        height:50px;
        margin:3px;
}
#main {
        float:left;
        width:400px;
        background-color:#666666;
        height:100%;
        position:absolute;
        left:200px;
        border:2px #FFFFFF solid;
}
#right {
        float:right;
        width:200px;
        background-color:#999999;
        height:100%;
        border:2px #FFFFFF solid;
}
#left  {
        float:left;
        width:200px;
        background-color:#333333;
        height:100%;
        border:2px #FFFFFF solid;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<div id="head"></div>
<div id="main"></div>
<div id="right"></div>
<div id="left"></div>
</body>
</html>

TOP

回复 4# 命若琴弦 的帖子

第三题MS不符合题意噢。。。
只有经历,才感觉可贵,只有坚强,才能出众!

TOP

只有经历,才感觉可贵,只有坚强,才能出众!

TOP

这个是看 猫猫 那个改的 之前我用的 width: expression(this.clientWidth > 200? "200px" :this.clientWidth);
复制内容到剪贴板
代码:
<!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=gb2312" />
<title>无标题文档</title>
</head>
<style type="text/css">
<!--
body{
        margin:0px;
        padding:0px;
        font-size:12px;
        line-height:22px;
}
a {
text-decoration:none;
}
div,ul,li,img,p{
        margin:0;
        padding:0;
        border:none;
        list-style-type:none;
}

.newsList{
        margin:0px;
        width:300px;
        overflow:hidden;
        border:#000000 1px solid;
}
.newsList ul{
        overflow:hidden;
}
.newsList li{
        width:300px;
        border-bottom:1px dotted #ddd;
        list-style:none;
        height:2em;
        overflow:hidden;
}
.newsList li a{
        float:left;
        width:auto;
        height:2em;
        position:relative; /*对象不可层叠,但将依据 left , right , top , bottom 等属性在正常文档流中偏移位置*/
        padding:0 70px 0 5px;  /* 右边距= 10px + 12px(font-size)x5(span内中文字数) */
        overflow:hidden;
}
.newsList li a span {
        color:#6CF;
        background:#fff;       
        position:absolute;/*将对象从文档流中拖出,使用 left , right , top , bottom 等属性相对于其最接近的一个最有定位设置的父对象进行绝对定位。如果不存在这样的父对象,则依据 body 对象。而其层叠通过 z-index 属性定义*/
        padding-left:10px;
        top:0;
        right:0;
}
-->
</style>
<body>
         <div class="newsList">
                 <ul>
                 <li><a href="#1">文本溢出自动省略测试文本溢出自动省略测试<span>2009-10-10</span></a></li>
                <li><a href="#1">文本溢出自动省略<span>2009-10-10</span></a></li>
                <li><a href="#1">文本溢出自动省略测试文本溢出自<span>2009-10-10</span></a></li>
          </ul>
        </div>
</body>
</html>
padding:0 70px 0 5px;  /* 右边距= 10px + 12px(font-size)x5(span内中文字数) */
这一行该如何理解

[ 本帖最后由 无光 于 2009-10-23 16:27 编辑 ]

TOP

那个就是要给日期留出来的宽度啊
日期部分是5个字宽
=^^=

TOP

谢谢 老猫

TOP

发新话题