为什么我这个搜索框设置了float: right,还是在下面呢
.download p {
color: #333;
font-size: 14px;
line-height: 14px;
}
为什么我把line-height调成12,甚至6px,小米商城APP这几个字都能显示完呢,不设置line-height属性的话就会被遮挡,想知道为什么能想到用这个属性,是个什么原理。
.black-nav-left li:hover>.download {
height: 148px;
这个是对于black-nav-left中所有li标签悬浮时的设置吗,为什么能实现只有悬浮到到下载APP上的时候才弹出而不是悬浮于任何一个li上时都弹出呢?
为什么19:28的时候margin-left: -62px;能使download这个div向左移动,这个62是怎么算出来的(哪个减去哪个)?
对于download这个div的css:
position: absolute之后,
left: 50%; 是距离父容器的左边的垂直线往右父容器宽度的50%吗
为什么图片不能并排
米课项目 (4).zip
2022-02-15 (2).png
小米官网项目.zip
为什么我的鼠标移动到标签上面下面出来的div会一直闪烁看不清还有我一直都不能把手机图标移动在盒子里排成一列
background-position :这个属性会导致图片裁剪
问题:background-position 这个属性会导致图片比例变化吗?图片变形吗?
<!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?什么情况下只设置高度不设置宽度呢?
<!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> <style> *{ margin: 0; padding: 0; } body{ background-color: #f1f1f1; } .container{ width: 1240px; margin: 0 auto; } .container ul{ overflow: hidden; clear: both; } .container ul li{ position: relative; float: left; list-style: none; background-color: #fff; margin-top: 10px; margin-right: 9px; width: 303px; height: 375px; } .container ul li a img{ height: 230px; margin-top: 30px; } .container ul li:nth-child(4n){ margin-right: 0; } .container ul li a{ display: block; width: 100%; height: 100%; text-align: center; text-decoration: none; } .text .name{ display: block; color: #333; font-size: 16px; margin-bottom: 2px; } .text .desc{ display: block; color: #999; font-size: 14px; } .text .price i{ font-style: normal; font-size: 14px; bottom: 3px; } .text .price{ display: inline-block; color: #c00; font-size: 22px; padding-left: 14px; } .text .price em{ font-size: 16px; font-style: normal; } .product-sign{ position:absolute; top: 30px; left: 30px; display: block; width: 60px; height: 60px; background-color: #ff64a6; border-radius: 50%; line-height: 60px; color: #fff; font-size: 16px; text-align: center; } </style> </head> <body> <div class="container"> <ul> <li> <a href="#"> <img src="./1.png" alt=""> <div class="text"> <span class="name">魅族 18</span> <span class="desc">限时领券最高立省1000 | 12期免息</span> <span class="price"><i>¥</i>3900<em>起</em></span> </div> <span class="product-sign">免息</span> </a> </li> <li> <a href="#"> <img src="./1.png" alt=""> <div class="text"> <span class="name">魅族 18</span> <span class="desc">限时领券最高立省1000 | 12期免息</span> <span class="price"><i>¥</i>3900<em>起</em></span> </div> <span class="product-sign">免息</span> </a> </li> <li> <a href="#"> <img src="./1.png" alt=""> <div class="text"> <span class="name">魅族 18</span> <span class="desc">限时领券最高立省1000 | 12期免息</span> <span class="price"><i>¥</i>3900<em>起</em></span> </div> <span class="product-sign">免息</span> </a> </li> <li> <a href="#"> <img src="./1.png" alt=""> <div class="text"> <span class="name">魅族 18</span> <span class="desc">限时领券最高立省1000 | 12期免息</span> <span class="price"><i>¥</i>3900<em>起</em></span> </div> <span class="product-sign">免息</span> </a> </li> </ul> </div> </body> </html>
.container ul li{
position: relative;
}这里面的position一定要用relative相对定位吗?
有序列表可以这样嵌套吗:
<ol> <li>肉类: <ol> <li>猪肉</li> <li>鸡肉</li> <li>牛肉</li> </ol> </li> <li>蔬菜</li> <li>水果</li> </ol>
<!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> <style> ul { color: red; } </style> </head> <body> <ul> <li>你好</li> <li> <ul> <li>好的</li> <li>好的</li> <li>好的</li> </ul> </li> <li>你好</li> </ul> </body> </html>
这里改变样式直接用ul{}不就可以了,为什么要用ui li{}的后代选择器
你好老师,为啥我用新标签这个完全显示不了?没看出问题在哪儿 <!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> <style> .header{ width: 1400px; background-color: pink; } div{ margin-top: 10px; height: 600px; } .nav{ height: 80px; margin-top: 10px; background-color: pink; } .section{ width: 900px; margin-top: 10px; background-color: pink; height: 600px; float: left; } aside{ width: 480px; margin-top: 10px; background: pink; height: 600px; float: right; } .footer{ height: 80px; margin-top: 10px; background-color: pink; } </style> </head> <body> <header>头部</header> <nav>导航</nav> <div> <section>主要内容</section> <aside>侧边栏</aside> </div> <footer>脚部</footer> </body> </html>
为什么我的main主要内容和侧边栏显示不出来,代码如下: <!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> <style> .container{ width: 1400px; margin: 0 auto; } .header{ height: 80px; margin-top: 10px; background:pink } .nav{ height: 80px; margin-top: 10px; background: pink; } .main{ height: 500px; margin-top: 10px; } .mian .left{ float: left; width: 900px; height: 500px; background: pink; } .mian .right{ float: right; width: 480px; height: 500px; background: pink; } .footer{ height: 80px; background: pink; } </style> </head> <body> <div class="container"> <div class="header">头部</div> <div class="nav">导航</div> <div class="main"> <div class="left">主要内容</div> <div class="right">侧边栏</div> </div> <div class="footer">脚部</div> </div> </body> </html>
<
form
action
=
""
method
"post"
>
input
type
"text"
value
/>
button
"reset"
>重置</
</
那这个意思是不是说重置按钮只能重置同一个form表单下输入框的数据,那么本次实操中这个重置按钮的意义是什么?或者说用什么办法能实现整个表格的重置?
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637