web前端练习

01

代码:HTML部分

复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>search</title>
    <!-- 引入重置样式 -->
    <link rel="stylesheet" href="../reset.css">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="./index.css">
</head>
<body>
    <div class="search" >
        
        <div class="select-left ">
            <nav class="nav">
                <ul>
                    <li>
                        <a href="#" style="color: #11192d; font-weight: 500;" >宝贝 </a>
                       
                        
                        <ol>
                            <li>天猫</li>
                            <li>店铺</li>
                        </ol>
                    </li>
                </ul>   
            </nav>     
        </div>
        <div class="photo">
            <img width="18px"  src="./image/倒三角.png"/>
        </div>
        <form  action="#">
        <div class=" top-input">
            <input class="=search-input" type="text" placeholder="|">

        </div>
        <div class="icon">

            <div class="select-icon" >
                <span class="text">按图片搜索</span>
            </div>
        </div>
    </form>
        <div class="search-button">
            <button class="button" type="submit">搜索</button>
            
        </div>
    
    </div>
</body>
</html>

CSS部分

复制代码
ol,ul{
    list-style: none;
}
.search{
    width: 980px;
    height: 44px;
    border: 2px solid #ff5000;
    background: #fff;
    border-radius: 8px;
    position: relative;
    margin: 0 auto;
    top: 15px;
    display: flex;
}
.select-left{
    width: 68px;
    height: 38px;
    font-size: 14.5px;
    background: #fff;
    font-weight: 500;
    color: #11192d;
    font-family: Roboto, Helvetica Neue, Helvetica, Tahoma, Arial, PingFang SC, Microsoft YaHei;
    border-radius: 12px;
    margin-top: 2px;
    box-shadow: 0 24px 48px 0 rgba(0, 17, 51, .07);
}
nav.nav > ul > li:hover ol {
    display: block;
}
.nav>ul>li{
    width: 68px;
    height: 38px;
    text-align: center;
    cursor: pointer;
    line-height: 36px;

}
nav.nav ol {
    margin-top: -2px;
    background-color: #fff;
    color: #11192d;
    display: none;
}
nav.nav ol > li {
    height: 38px;
    
}
nav.nav ol > li:hover {
    color: #ff5000;
    
}
.photo{
    display: inline;
    margin-top: 15px;
    margin-left: -20px;
}
.top-input{
    width: 800px;
    height: 40px;
}
input{
    width: 800px;
    height: 40px;
    line-height: 40px;
    margin-left: 5px ;
}
.select-right{
    width: 28px;
    height: 28px;
    position: absolute;
    right: 80px;
    top: 6px;
    display: block;
}
.icon{
    width: 28px;
    height: 28px;
    position: absolute;
    right: 80px;
    top: 6px;
    z-index: 1;
    background-image: url(./image/hei下载.png);
    background-size: 28px 28px;
    box-sizing: border-box;
}
.icon:hover{
    background-image: url(./image/下载.png);
    cursor: pointer;
}
.select-icon{
    display: none;
    box-sizing: border-box;

}
.text{
    box-sizing: border-box;

}

.button{
    position: absolute;
    line-height: 39px;
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    background:#ff5000 ;
    height: 39px;
    width: 72px;
    top: 3px;
    right: 2px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    z-index: 9;
    outline: none;
}

运行:

相关推荐
10年前端老司机1 小时前
React无限级菜单:一个项目带你突破技术瓶颈
前端·javascript·react.js
阿芯爱编程5 小时前
2025前端面试题
前端·面试
前端小趴菜056 小时前
React - createPortal
前端·vue.js·react.js
晓13136 小时前
JavaScript加强篇——第四章 日期对象与DOM节点(基础)
开发语言·前端·javascript
菜包eo7 小时前
如何设置直播间的观看门槛,让直播间安全有效地运行?
前端·安全·音视频
烛阴7 小时前
JavaScript函数参数完全指南:从基础到高级技巧,一网打尽!
前端·javascript
chao_7898 小时前
frame 与新窗口切换操作【selenium 】
前端·javascript·css·selenium·测试工具·自动化·html
天蓝色的鱼鱼9 小时前
从零实现浏览器摄像头控制与视频录制:基于原生 JavaScript 的完整指南
前端·javascript
三原9 小时前
7000块帮朋友做了2个小程序加一个后台管理系统,值不值?
前端·vue.js·微信小程序
popoxf9 小时前
在新版本的微信开发者工具中使用npm包
前端·npm·node.js