input:search设置height样式无效
导航栏中的input设置成 type=search时,height属性无效了,weight属性有效。同样的css在type=text时却没有这个问题,能够正常控制宽高。
html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | <!DOCTYPE html> < html > < head > < meta charset = "UTF-8" > < title >5-2</ title > < link rel = "stylesheet" href = "css/style.css" > < script src = "js/script.js" ></ script > </ head > < body > < header > <!-- 导航栏 --> < nav > <!-- 图标 --> < div class = "icon" >< img src = "image/logo.png" ></ div > <!-- 分页选项卡 --> < div class = "tab-list" > < a href = "#" >课程</ a > < a href = "#" >职业路径</ a > < a href = "#" >实战</ a > < a href = "#" >猿问</ a > < a href = "#" >手记</ a > </ div > <!-- 搜索框和个人头像 --> < div class = "data-detail" > < input type = "search" placeholder = "前端入门" > < button >< img src = "icon-1-sprite_w22.png" alt = "搜索" ></ button > < a href = "#" >< img src = "" ></ a > < a href = "#" >< img src = "" ></ a > < a class = "profile" href = "#" >< img src = "" alt = "profile" ></ a > </ div > </ nav > </ header > < section class = "banner" > < h3 >我的购物车</ h3 > </ section > < section class = "main" > < div class = "container" > <!-- 购物车头部 --> < div class = "shopping-car-header" > < input type = "checkbox" id = "all-checked" >全选 < span >商品名称</ span > < span >总价</ span > < span >单价</ span > < span >数量</ span > < span >操作</ span > </ div > <!-- 商品信息 --> < div class = "shopping-car-list" ></ div > <!-- 购物车结算信息 --> < div class = "shopping-car-footer" > < p >应付金额< span ></ span ></ p > < input type = "button" value = "去结算" > </ div > </ div > </ section > < footer > < div class = "container" > <!-- 其他链接和版权信息 --> < div class = "link-list" > < a href = "#" >网站首页</ a > < a href = "#" >企业合作</ a > < a href = "#" >人才招聘</ a > < a href = "#" >联系我们</ a > < a href = "#" >讲师招募</ a > < a href = "#" >常见问题</ a > < a href = "#" >意见反馈</ a > < a href = "#" >慕课大学</ a > < a href = "#" >友情链接</ a > </ di > < p class = "copyright" >Copyright © 2017 imooc.com All Rights Reserved | 京ICP备 | 13046642号-2</ p > <!-- 分享图标 --> < div class = "link-icon" > < span >< img src = "" ></ span > < span >< img src = "" ></ span > < span >< img src = "" ></ span > </ div > </ div > </ footer > </ body > </ html > |
css
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | /*all*/ * { margin : 0 ; padding : 0 ; } a { text-decoration : none ; } a:link, a:visited, a:active { color : black ; } /*header*/ header { /*text-align: center;*/ width : 100% ; height : 70px ; background-color : black ; } nav { float : left ; height : 70px ; } nav > . icon { margin-left : 10px ; height : 70px ; width : 128px ; display : inline- block ; transform: translateY( 15px ); } nav > .tab-list { margin-left : 70px ; font-size : 0 ; display : inline- block ; } nav > .tab-list a { text-align : center ; display : inline- block ; width : 100px ; font-size : 17px ; height : 70px ; line-height : 70px ; color : white ; } nav > .tab-list a:nth-child( 2 ):after { top : 11px ; height : 16px ; width : 16px ; position : absolute ; content : "" ; background-image : url ( "../image/icon-new.png" ); } nav > .data-detail { float : right ; } nav > .data-detail > input { display : inline- block ; height : 150px ; width : 200px ; } |
19
收起
正在回答 回答被采纳积分+1
2回答
HTML5与CSS3实现动态网页 2018
- 参与学习 1887 人
- 提交作业 4643 份
- 解答问题 5760 个
有HTML和CSS基础,却不知道如何进阶?本路径带你通过系统学习,完成从“会做网页”到“做出好的动态网页”的蜕变,迈出成为前端工程师的第一步。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧