HTML: <!-- 79-小米.html --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>小米</title> <link rel="stylesheet" href=".\css\reset.css"> <link rel="icon" href=".\images\favicon.ico"> <link rel="stylesheet" href=".\css\mi.css"> </head> <body> <!-- 头部开始 --> <div class="header"> <a href="#"><img src=".\images\a2a9e6db5e3c5374301827435d8595c6.jpg" alt="照片无法显示"></a> </div> <!-- 头部结束 --> <!-- 黑色导航条 --> <div class="nav"> <div class="wrap"> <div class='left'> <ul> <li><a href="#">小米商城</a><span>|</span></li> <li><a href="#">MIUI</a><span>|</span></li> <li><a href="#">IOT</a><span>|</span></li> <li><a href="#">智能手机</a><span>|</span></li> <li><a href="#">智能手机</a><span>|</span></li> <li><a href="#">智能手机</a><span>|</span></li> <li><a href="#">智能手机</a><span>|</span></li> <li><a href="#">智能手机</a><span>|</span></li> <li><a href="#">智能手机</a><span>|</span></li> <li><a href="#">智能手机</a><span>|</span></li> <li class='download'><a href="#">下载App</a><span>|</span> <div class="triangle"></div> <div class='download-QRcode'> <img src="./images/download.png" alt="无法显示"> <p>小米商城APP</p> </div> </li> <li><a href="#">智能手机</a><span>|</span></li> <li><a href="#">智能手机</a><span>|</span></li> </ul> </div> <div class="right"> <div class='user-info'> <ul> <li><a href="">登录</a></li> <li><a href="">注册</a></li> <li class='message'><a href="#">消息通知</a></li> </ul> </div> <div class='shop-cart'> <p><img src="" alt=""><span>购物车</span></p> <div class='triangle'></div> <div class="cart-list"></div> </div> </div> </div> </div> </body> </html>
CSS
body{ background-color: blueviolet; } .header{ width: 100%; height: 120px; /* overflow: hidden; */ /* position: relative; */ } .header img{ height: 120px; margin: 0 auto; /* position: absolute; left: 50%; transform: translate(-50%); */ } .nav{ width: 100%; height: 40px; background-color: #333333; } .wrap{ height: 40px; width: 1226px; margin: 0 auto; /* background-color: pink; */ } .wrap .left{ /* width: 900px; */ height: 40px; line-height: 40px; float: left; /* background-color: orange; */ } .wrap .left>ul>li{ /* width: 69px; */ /* padding:0 5px; */ float: left; box-sizing: border-box; text-align: center; } .wrap .left>ul>li>a{ font-size: 12px; color: #a4a484; } .wrap .left>ul>li:hover>a{ color: white; } .wrap .left span{ margin: 0 3.6px; } .wrap .right{ float: right; display: flex; justify-content: space-around; } .wrap .right .user-info{ width:137px; height: 40px; line-height: 40px; margin: 0 5px; float: left; /* background-color: yellow; */ } .wrap .user-info .message{ margin: 0 10px; } /* .wrap .user-info>ul>li{ /* float: left; */ /* .wrap .user-info>ul{ justify-content:space-around ; display: flex; } */ .user-info ul{ display: flex; justify-content: space-between; } .wrap .user-info>ul>li>a{ font-size: 12px; color: #a4a484; } .wrap .shop-cart{ float: right; width: 120px; height: 40px; line-height: 40px; background-color:paleturquoise; position: relative; } .wrap .shop-cart:hover{ background-color: white; } .wrap .shop-cart p{ font-size: 12px; color: #a4a484; } .wrap .shop-cart .cart-list{ width: 316px; height: 100px; background-color: white; position: absolute; bottom: -100px; left: -196px; display: none; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); } .wrap .shop-cart:hover>p{ color: orange; } .wrap .shop-cart:hover .cart-list{ display: block; } .download{ /* width: 124px; */ position: relative; transition: all .3s; } .download:hover>.download-QRcode{ display: block; } .download:hover>.triangle{ display: block; } .download .triangle{ width: 0; height: 0; border-bottom: 8px solid white; border-left: 8px solid transparent; border-right: 8px solid transparent; position: absolute; bottom: 0; left: 42%; transform: translate(-8px); display: none; /* z-index: 999; */ } .download .download-QRcode{ width: 124px; height: 148px; position: absolute; top: 40px ; left: 50%; transform: translate(-62px); background-color: white; text-align: center; display: none; /* transition: all 10s; */ } .download .download-QRcode img{ width: 90px; margin: 18px 0 12px; } .download .download-QRcode p{ position: relative; bottom: 26px; font-size: 14px; }
老师我那个transition设置了all 0.3s为什么没有反应?
.{: %;: ;: ; } .{: ;: ;: ;:} .>{: ;: ;: ;: ;: ;: ;} .>:(){: ;} .{: ;: } {: ;: } 1111
<link rel="stylesheet" href="CSS/iconfont.css"/> <link rel="icon" href="images/title.ico"/>
老师,这俩在哪里能找到?
长代码换行
第2中方法对我来说没用, 我看了下格式也是对的
想问一下,<img /> 是/单标签 之前说后面的斜杠可以不写 这里的老师加了src的属性后就没有写斜杠结束了 是因为单标签的斜杠可以不写吗?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <!-- 盒子模型之组成部分: 1.内容区域 Content 1) 默认大小:由内容本身大小撑开 2)手动设置:由width和height两个属性来完成盒子大小设置 2.内边距 Padding 3.外边框 Border 4.外边距 Margin--> <!-- 实操细节: 1.宽度设置百分比生效 2.高度设置百分比不生效,高度一般设置px --> <style> .image{ width:30%; /*手动设置了图片内容大小,不压缩比例,只设置高度即可*/ /* 因为手机屏幕大小不是固定尺寸的,所以手机宽度一般设置百分比,这样可以适配各种尺寸的手机, 为原比例的30% */ } </style> </head> <body> <img class="image" src="hmbb.jpg" alt="海绵宝宝"> </body> </html>
问题:为什么高度height设置百分比不生效呢?
搞不懂这个实操细节,意思是设置高度只能用XXpx,而宽度可以是XXpx和百分比吗?
那什么情况下,只设置width,不设置height?什么情况下只设置高度不设置宽度呢?
<div class="zhu"> <div class="zhu-center"> < img src="images/u=1487180403,3048898319&fm=15&gp=0.jpg" alt=""> <div class="center-left"> <ul> <li>< a href=" "><div>手机 电话卡<i class="iconfont"></i></div></ a></li> <div class="right-list"> <ul> <li>< a href="#"> < img src="images/c89e7b3a3495acaa0a4df271d9da59ea.png" alt=""> <p>小米10S</p > </ a></li> </ul> </div> </ul> </div> </div> </div> .zhu{ width: 100%; height: 460px; position: relative; } .zhu-center{ width: 1226px; height: 100%; position: absolute; left: 50%; margin-left: -613px; } .center-left{ width: 234px; height: 460px; padding: 20px 0 ; background-color: rgba(105,101,101,.6); box-sizing: border-box; position: absolute; left: 0; top: 0; } .center-left li{ width: 234px; height: 42px; padding-left: 30px; box-sizing: border-box; font-size: 14px; line-height: 42px; text-align: left; } .center-left a{ color: #fff; } .center-left i{ float: right; padding-right: 20px; } .center-left>ul>li:hover{ background-color: #ff6700; } .center-left>ul>li:hover .right-list{ display: block; } .center-left>ul li:hover i{ color: #e0e0e0; } .right-list { width: 992px; height: 460px; position: absolute; top: 0; left: 234px; border: 1px solid #e0e0e0; border-left: none; background-color: #fff; padding: 2px 0; box-sizing: border-box; box-shadow: 0 8px 16px rgba(0,0,0,.18); display: none; } .right-list>ul{ float: left; width: 247.75px; height: 100%; box-shadow: none; } .right-list li{ height: 76px; width: 100%; padding: 18px 20px 18px 20px; box-sizing: border-box; } .right-list p{ color: #333; font-size: 14px; line-height: 40px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; float: left; } .right-list img{ float: left; margin-right: 14px; } .right-list li:hover p{ color: #ff6700; } 老师,我想问问,怎么我鼠标悬停在左边的li上,右边的list不出现
老师为什么我这个右边的列表的宽度是无效的,设置了还是这样哪里的问题呢
.cart-Details{display: none;transition:all 10s ease-in-out;}.cart:hover>.cart-Details{ display: block;}在购物车的下拉框实现过渡效果中 用滑动门的思路为什么不能出现这个过渡的效果呢?能出现下拉框但是不是过渡的效果了
03_mi.html.rar
老师引入link中“icon”是什么,老师是网页图标是什么意思
如何在下拉框中加placeholder呢,让选择教员方向不可选
<!DOCTYPE > <> <> <> <></> <> : : : : : : : : :: : : : : : : : : : : : : : : :: : : : : : </> </> <> <> <></> <> <></> <></> </> <></> </> </> </>
这里面说的太快了,没有说注释的含义, 突然说取消注释有点蒙, 我不知道这意义是在哪
还有这刚开始p*10+tab 产生 <p></p>.... 10个
也没说必须要有个<!-->
-->在上面
同理嵌套也得有个 >
所以我就怕我之后看的很蒙
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <table align="center" border="1" width="500" height="500"> <tr> <td colspan="2"></td> <td rowspan="2"></td> </tr> <tr> <td rowspan="2"></td> <td></td> </tr> <tr> <td colspan="2"></td> </tr> </table> <hr> <table border="10" align="center" width="600" > <caption>学生信息表</caption> <tr> <th colspan="3">学生基本信息</th> <th colspan="2">成绩</th> </tr> <tr> <th>姓名</th> <th>性别</th> <th>专业</th> <th>课程</th> <th>分数</th> </tr> <tr align="center"> <td>球球</td> <td>男</td> <td rowspan="2">计算机</td> <td rowspan="3">程序设计</td> <td>68</td> </tr> <tr align="center"> <td>楠楠</td> <td>女</td> <td>89</td> </tr> <tr align="center"> <td>小明</td> <td>男</td> <td>会计</td> <td>68</td> </tr> <tr align="center"> <td>小明</td> <td>男</td> <td>建筑</td> <td>建筑设计</td> <td>68</td> </tr> </table> </body> </html>
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战未来微信公众号
百战未来微信小程序
©2014-2026百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637