首页 话题 小组 问答 好文 用户 我的社区 域名交易 唠叨

[分享]css3搜索框样式代码

发布于 2024-11-11 15:48:16
0
14

CSS3搜索框样式代码

/* 搜索框样式 */
.search-box {
    width: 300px;
    height: 40px;
    position: relative;
    margin: 20px auto;
}

/* 搜索框输入样式 */
.search-box input[type="text"] {
    width: 100%;
    height: 100%;
    border: none;
    background-color: #F5F5F5;
    border-radius: 20px;
    padding: 0 20px;
    font-size: 14px;
}

/* 搜索按钮样式 */
.search-box button[type="submit"] {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border: none;
    background-color: #FFA500;
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all .3s ease-in-out;
}

/* 鼠标移入时的搜索按钮样式 */
.search-box button[type="submit"]:hover {
    background-color: #FFC269;
}

/* 鼠标点击时的搜索按钮样式 */
.search-box button[type="submit"]:active {
    transform: scale(.95);
} 

以上就是CSS3搜索框样式代码的实现方法,可以在项目中使用这些样式,让你的搜索框更美观、易用。

评论
一个月内的热帖推荐
91云脑
Lv.1普通用户

62849

帖子

14

小组

291

积分

赞助商广告
站长交流