美文网首页
第三次编程

第三次编程

作者: 星星yx | 来源:发表于2017-01-31 22:31 被阅读0次

1.让三个DIV并排显示(三种方法实现)

第一种方法:inline-block
<!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>方法1</title>
<style>
div{
    width:100px;
    height:100px;
    color:black;
    background-color:red;
    display:inline-block;
    }
</style>
</head>

<body>
<div class="box">DIV</div>
<div class="box">DIV</div>
<div class="box">DIV</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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>方法2</title>
<style>
div{
    width:100px;
    height:100px;
    background-color:red;
    color:black;
    float:left;
    margin:5px;
}
</style>
</head>

<body>
<div class="box1">DIV</div>
<div class="box2">DIV</div>
<div class="box3">DIV</div>
</body>
</html>
2.png
第三种方法:定位
<!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>方法3</title>
<style>
div{
    width:100px;
    height:100px;
    background-color:red;
    color:black;
}
.box2{
    position:relative;
    left:110px;
    bottom:100px;
}
.box3{
    position:relative;
    left:220px;
    bottom:200px;
}
</style>
</head>

<body>
<div class="box1">DIV1</div>
<div class="box2">DIV2</div>
<div class="box3">DIV3</div>
</body>
</html>
3.png

2.腾讯大学—列表页

<!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>作业2</title>
<style>
body div span dl dt dd{
    padding:0px;
    margin:0px;     /*清除默认样式*/
}
.list{
    padding:0px 20px;
    width:226px;      /*设置整体的宽度,高度有整体内容撑开*/
}
.tittle{
    background:url(icon-rank.png) no-repeat left bottom;
    padding:20px 0px 0px 30px;
}
#box{
    margin:0px;
    padding:0px;
    width:226px;
    height:34px;
    background:url(rank-tab-gray-bg.png) no-repeat left bottom;
}
a{
    text-decoration:none;
    color:#000;
}
.tittle1{
    margin:0px;
    margin-left:2px;
    padding:10px 27px;
    border:1px solid #cccccc;
    border-bottom:none;
    border-right:none;
    font-size:14px;
    line-height:24px;
}
.tittle2{
    margin:0px;
    margin-right:2px;
    padding:10px 27px;
    border:1px solid #cccccc;
    border-top:none;
    border-right:none;
    font-size:14px;
    line-height:24px;
}
.lb1{
    margin-top:15px;
    height:160px;
    width:226px;    
    background:url(1452663224623.jpg) no-repeat;
}
.lb2{
    margin-top:20px;
    height:160px;
    width:226px;
    background:url(1466672022953.jpg) no-repeat;
}
.lb3{
    margin-top:20px;
    height:160px;
    width:226px;
    background:url(1416453832912.png) no-repeat;    
}
.lb4{
    margin-top:20px;
    height:160px;
    width:226px;
    background:url(1445345193444.jpg) no-repeat;
}

.lb5{
    margin-top:20px;
    height:160px;
    width:226px;
    background:url(1403269947115.png) no-repeat;    
}        /*图片的5大板块*/
.xbt1{
    width:8px;
    height:26px;
    font:bold 9px/24px '微软雅黑';
    color:#FFF;
    padding:0px 6px;
    background:#e2291c;
    display:inline-block;
    position:relative;
    top:125px;  
}
.xbt2{
    width:8px;
    height:26px;
    font:bold 9px/24px '微软雅黑';
    color:#FFF;
    padding:0px 6px;
    background:#ec5a2e;
    display:inline-block;
    position:relative;
    top:125px;  
}
.xbt3{
    width:8px;
    height:26px;
    font:bold 9px/24px '微软雅黑';
    color:#FFF;
    padding:0px 6px;
    background:#f6a544;
    display:inline-block;
    position:relative;
    top:125px;  
}
.xbt4{
    width:8px;
    height:26px;
    font:bold 9px/24px '微软雅黑';
    color:#FFF;
    padding:0px 6px;
    background:#ec5a2e;
    display:inline-block;
    position:relative;
    top:125px;  
}
.xbt5{
    width:8px;
    height:26px;
    font:bold 9px/24px '微软雅黑';
    color:#FFF;
    padding:0px 6px;
    background:#f6a544;
    display:inline-block;
    position:relative;
    top:125px;  
 }     /*5个小序号的样式*/
.nr2{
    width:196px;
    height:26px;
    padding-left:10px;
    background:#0b1213;
    display:inline-block;
    position:relative;
    top:134px;
    opacity:0.5;    
}   /*小透明度的设置*/ 
.nr3{
    width:196px;
    height:26px;
    font:bold 12px/26px '微软雅黑';
    color:#FFF;
    display:inline-block;
    position:relative;
    left:30px;
    top:99px;  /*字体的设置,为了防止字体也有透明度,所以在此处加上这个*/
}
dt{
    height:20px;
    padding-left:6px;
    background:url(icon-rank-item.png) no-repeat;
    word-spacing:16px;
    font:12px/20px '微软黑体';
    color:#000000;
    overflow:hidden;
}
dd{
    height:10px;
}     /*为了设置列表中的空位*/
</style>
</head>
<body>
  <div class="list">
        <h2 class="tittle">排行榜</h2>
        <div id="box">
            <span class="tittle1"><a href="#">最热排行</a></span><span class="tittle2"><a href="#">最新上线</a></span>
        </div>
        <a href="#"><div class="lb1">
            <span class="xbt1">1</span><span class="nr2"></span><span class="nr3">张小龙:微信四大价值观</span>
        </div></a>
        <a href="#"><div class="lb2">
            <span class="xbt2">2</span><span class="nr2"></span><span class="nr3">刘超:互联网时代需要什么样的UX设计人才?</span>
        </div></a>
        <a href="#"><div class="lb3">
            <span class="xbt3">3</span><span class="nr2"></span><span class="nr3">马化腾:腾讯将专注于互联网的连接器</span>
        </div></a>
        <a href="#">
        <div class="lb4">
            <span class="xbt4">4</span><span class="nr2"></span><span class="nr3">IT领袖会圆桌会议:互联网下一个风口在哪儿</span>
        </div></a>
        <a href="#"><div class="lb5">
            <span class="xbt5">5</span><span class="nr2"></span><span class="nr3">微信支付对实体商业的价值几何?</span>
        </div></a>
    <a href="#"><dl>
        <dt>6 张小龙:小程序正式发布,开启移送应用新时代</dt>
        <dd></dd>
        <dt>7 马化腾:通向互联网未来的七个路标</dt>
        <dd></dd>
        <dt>8 马化腾:腾讯现在只做两件事</dt>
        <dd></dd>
        <dt>9 使用UE4制作VR内容的优化</dt>
        <dd></dd>
         <dt>10 何凌南:谣言在想什么?</dt>
        <dd></dd>
        </dl></a>
    </div>
</body>
</html>
123.png 1234.png

百度链接:http://pan.baidu.com/s/1kVLmrmn 密码:d8f9

相关文章

  • Python成为2018年最火编程语言,到底为啥?

    根据TIOBE排行榜的数据,Python获得了2018年年度编程语言的称号,这已经这门语言第三次获得“年度编程语言...

  • 第三次编程

    1.让三个DIV并排显示(三种方法实现) 2.腾讯大学—列表页 百度链接:http://pan.baidu.com...

  • 第三次编程作业

    这次的编程真的是陆陆续续的搞了好久今天终于一口气都给补完了 心累..第二个编程 做的有点糙...我真的是尽力了最后...

  • Netty技术分享

    这是在团队里的第三次技术分享,分享了主流的Java网络编程框架,以下是幻灯页主要内容,可以当作入门的资料。 个人博...

  • 第三次任务(Javascript 编程入门)

    TW实验室 羊咩咩-徐娆 a.Javascript基础练习 1.求两个数的余数 给定两个数字,求第一个数字除以第二...

  • 第三次任务(Javascript 编程入门)

    要求 1.通过写代码使练习库a的所有测试通过: 在命令行终端执行npm test后测试全部通过,没有报错;2.通过...

  • 对编程的第三次理解

    如题所言,在我刚入三月软件学习编程的时候,我还是一个彻头彻尾的小白。完全不懂什么意思,只会刻板的搬运。曾记得我当初...

  • 智慧城市的引路者

    今天是机器人社团第三次活动,孩子们开始自由创作并真正的接触编程啦! 孩子们今天都早早的来到了教室,没有...

  • JAVA的发展历史:让你彻底读懂JAVA语言——北邮在线

    物联网被称为继计算机、互联网之后世界信息产业的第三次浪潮。 Java是一门面向对象编程语言,不仅吸收了C++语言的...

  • 为什么一定要给孩子找个程序员爸爸?

    程序员是一个随着第三次工业革命诞生的职业群体,拥有专业技能、爱代码、爱编程、爱生活,为互联网的飞速发展作出了卓越贡...

网友评论

      本文标题:第三次编程

      本文链接:https://www.haomeiwen.com/subject/pwqxittx.html