Correction status:Uncorrected
Teacher's comments:
重写了2次,慢慢熟悉布局。还是得多写多练,熟悉什么地方布局常用什么样的解决方案。
三角形用CSS实现方式如下,需要指向什么方向的三角形,就将对面的边框显示就好。
<!DOCTYPE html> <html> <head> <title></title> <style type="text/css"> .arrow{ width: 0px; height: 0px; border: 7px solid #000; border-color: transparent #f00 transparent transparent; } </style> </head> <body> <div class="arrow"></div> </body> </html>
点击 "运行实例" 按钮查看在线实例
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>优酷-这世界很酷</title> <link rel="stylesheet" type="text/css" href="static/css/style.css"> <link rel="icon" type="image/x-icon" href="static/images/favicon.ico"> <link rel="stylesheet" type="text/css" href="static/font-awesome/css/font-awesome.min.css"> </head> <body> <div class="header"> <!-- 轮播模块 --> <div class="pic_show"> <div class="bg"></div> <div class="contents header_r"> <div class="header_r_menu r"> <a href=""><span>2019两会闭幕:</span>全程回顾解读热点</a> <a href=""><span>2019两会闭幕:</span>全程回顾解读热点</a> <a href=""><span>2019两会闭幕:</span>全程回顾解读热点</a> <a href=""><span>2019两会闭幕:</span>全程回顾解读热点</a> <a href=""><span>2019两会闭幕:</span>全程回顾解读热点</a> <a href=""><span>2019两会闭幕:</span>全程回顾解读热点</a> <a href="" style="border-bottom: none;"><span>2019两会闭幕:</span>全程回顾解读热点</a> </div> </div> </div> <!-- 顶部搜索导航条 --> <div class="contents header_ul"> <div class="logo l mt"> <a href=""><img src="static/images/logo.png"></a> <form> <input type="text" name=""> <button>全网搜</button> </form> </div> <ul class="menu_li r mt"> <li><a href="" style="color: #c4a24a"><i class="fa fa-bank" style="color: #c4a25a"></i><br>VIP</a></li> <li><a href=""><i class="fa fa-feed"></i><br>订阅</a></li> <li><a href=""><i class="fa fa-clock-o"></i><br>记录</a></li> <li><a href=""><i class="fa fa-arrow-up"></i><br>上传</a></li> <li><a href=""><i class="fa fa-television"></i><br>客户端</a> <div class="box"> <div class="arrow"></div> <p>登录使用更多功能</p> <form> <button>登录/注册</button> </form> </div> </li> <li><a href=""><img src="static/images/80.png" width="40px"></a> <div class="box"> <div class="arrow"></div> <p>登录使用更多功能</p> <form> <button>登录/注册</button> </form> </div> </li> </ul> </div> <div class="clear"></div> </div> <div class="contents"> <div class="content"> <ul class="voltage"> <li><a href="">剧集</a><a href="">电影</a><a href="">综艺</a><a href="">动漫</a><a href="">娱乐</a><a href="">生活</a></li> <span class="b_r"></span> <li><a href="">剧集</a><a href="">电影</a><a href="">综艺</a><a href="">动漫</a><a href="">娱乐</a><a href="">生活</a></li> <span class="b_r"></span> <li><a href="">剧集</a><a href="">电影</a><a href="">综艺</a><a href="">动漫</a><a href="">娱乐</a><a href="">生活</a></li> <span class="b_r"></span> <li><a href="">剧集</a><a href="">电影</a><a href="">综艺</a><a href="">动漫</a><a href="">娱乐</a><a href="">生活</a></li> <span class="b_r"></span> <li style="width: 75px;"><a href="">剧集</a><a href="">电影</a></li> <span class="b_r"></span> <li class="hoc"><a href=""><i class="fa fa-feed"></i><br>优酷片库</a></li> <li class="hoc"><a href=""><i class="fa fa-clock-o"></i><br>指数排行</a></li> <li class="hoc"><a href=""><i class="fa fa-arrow-up"></i><br>大鱼号精选</a></li> <li class="hoc"><a href=""><i class="fa fa-arrow-up"></i><br>下载应用</a></li> </ul> </div> <div class="clear"></div> </div> <div class="contents"> <div class="content"> <div class="content_ul"><h2>正在热播</h2></div> <ul class="hot_tv"> <li><a href=""><img src="static/images/a.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/b.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/c.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/d.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/e.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/f.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/g.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> </ul> <div class="clear"></div> </div> <div class="content"> <div class="content_ul"> <h2 class="l mr">剧集 ></h2> <ul class="tab"> <li><a href="">最新</a></li> <li><a href="">大陆剧</a></li> <li><a href="">日韩剧</a></li> <li><a href="">港台剧</a></li> <li><a href="">英美剧</a></li> </ul> </div> <div class="clear"></div> <div class="tv_show l"> <a href=""><img src="static/images/tv.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small> </div> <ul class="tv_tab"> <li><a href=""><img src="static/images/tv1.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/tv2.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/tv3.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/tv4.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/tv5.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/tv1.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/tv2.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/tv3.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/tv4.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/tv5.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> </ul> <div class="clear"></div> </div> <div class="content"> <div class="content_ul"><h2>正在热播</h2></div> <ul class="hot_tv"> <li><a href=""><img src="static/images/a.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/b.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/c.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/d.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/e.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/f.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> <li><a href=""><img src="static/images/g.jpg"><br><span>瞰中国</span></a><br> <small>低调的宁夏 美了四季</small></li> </ul> <div class="clear"></div> </div> </div> </body> </html>
点击 "运行实例" 按钮查看在线实例
*{ margin: 0;padding: 0; } .clear{ clear:both; } a{ text-decoration: none;color: #000; } li{ list-style: none; float: left; } .l{ float: left; } .r{ float: right; } .mt{ margin-top: 20px; } .mr{ margin-right: 10px; } .header{ width: 100%;height: 520px; background: #072439; } .pic_show{ width: 1664px;height: 520px; background: url(../images/y1.jpg); margin: 0 auto; position: relative; } .bg{ width: 100%;height: 100%; background: url(../images/y.png); position: absolute;top:0;left: 0; z-index: 99; } .header_r{ position: absolute;top: 100px;right: 45px; z-index: 100; } .header_r_menu{ width: 190px; padding: 0px 15px; background: rgba(0,0,0,0.2); } .header_r_menu a{ display: block; padding: 10px 0px; color: rgba(254,254,254,0.6); font-size: 14px; line-height: 25px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid rgba(147,147,147,0.4); } .header_r_menu a:hover span{ font-size: 20px;display: block;color: #fff; } .header_r_menu a:hover{ color: #fff; } .contents{ width: 1750px; margin: 0 auto; } .content{ width: 100%; margin-top: 20px; } .voltage li{ width: 230px;font-size: 15px;line-height: 30px; } .voltage a{ padding-right: 45px;color: #6d7076; } .b_r{ border-right: 2px solid #f2f2f2; height: 45px; display: inline-block; float: left; margin-top: 7px; margin-right: 40px; } li.hoc{ width: 80px;text-align: center;padding-right: 30px; } li.hoc i{ color: #666;font-size: 17px; } li.hoc a{ color: #666;padding: 0; } .header_ul{ position: fixed;top: 0; z-index: 100; } .logo{ margin-left: 90px; } .logo form{ display: inline-block; width: 500px;height: 40px; margin-left: 500px; position: relative; } .logo input{ width: 480px;height: 40px;padding-left: 20px;color: #fff; border-radius: 20px;border: none; outline:none; background: rgba(234,234,234,0.5); } .logo button{ width: 90px;height: 40px; border-top-right-radius: 20px;border-bottom-right-radius: 20px; background: #b30702;border: none;color: #fff; position: absolute;right: 0;top: 0; } .menu_li a,i{ color: rgba(234,234,234,0.5); } .menu_li li{ padding: 0 10px;text-align: center;font-size: 12px; position: relative; } .menu_li i{ font-size: 18px; } .menu_li img{ margin-top: -5px; } .menu_li li:hover a{ color:#48adf2; } .menu_li li:hover i{ color: #48adf2; } .menu_li li:hover .box{ display: block; } .menu_li .box{ position: absolute;top: 50px;right: -10px; background: #fff; padding: 20px; display: none; } .menu_li form{ width:240px;height: 51px; } .menu_li p{ color: #ccc;font-size: 16px; } .menu_li button{ background: #2798ff; color: #fff; border: none; height: 36px;width: 240px; border-radius: 18px; margin-top: 15px; } .arrow{ width: 0px;height: 0px;border: 7px solid; border-color: transparent transparent #fff transparent; position: absolute;top: -14px;right: 32px; } .content_ul{ line-height: 60px; } .hot_tv img{ width: 240px; height: 360px; } .hot_tv li{ margin-right: 6px; } .tab li{ margin-left: 10px; } .tv_show{ margin-right: 6px; } .tv_show img{ width: 486px; } .tv_tab img{ width: 240px; height: 135px; margin-right: 6px; } .tv_tab li{ margin-bottom: 15px; }
点击 "运行实例" 按钮查看在线实例