子比美化 – 方形搜索框美化

温馨提示:本文最后更新于2025-01-26 17:02:26,某些文章具有时效性,若有错误或已失效,请在下方留言或联系站长

图片[1]-子比美化 – 方形搜索框美化-胖大海博客资源网

有人觉得7b2的方形更加好看,所以用css和js写了样式,下面教程开始

自定义css

.header-slider-search .line-form{
border-radius:5px;
}
.header-slider-search .line-form .abs-right button{
background: #0088ff;
color: rgb(255, 255, 255);
border-radius: 5px;
margin-right: -28px;
height: 51.28px;
padding: 10px;
border-bottom-left-radius: 0px;
border-top-left-radius: 0px;
}
@media(max-width: 767px) {
.header-slider-search .line-form .abs-right button {
height: 38px; /* 手机时的高度 */
}
}
.header-slider-search .line-form .abs-right .icon{
color:#fff;
}
.header-slider-search .line-form{
  border-radius:5px;
}
.header-slider-search .line-form .abs-right button{
    background: #0088ff;
    color: rgb(255, 255, 255);
    border-radius: 5px;
    margin-right: -28px;
    height: 51.28px;
      padding: 10px;
    border-bottom-left-radius: 0px;
    border-top-left-radius: 0px;
}
@media(max-width: 767px) {
    .header-slider-search .line-form .abs-right button {
        height: 38px; /* 手机时的高度 */
    }
}
.header-slider-search .line-form .abs-right .icon{
  color:#fff;
}
.header-slider-search .line-form{ border-radius:5px; } .header-slider-search .line-form .abs-right button{ background: #0088ff; color: rgb(255, 255, 255); border-radius: 5px; margin-right: -28px; height: 51.28px; padding: 10px; border-bottom-left-radius: 0px; border-top-left-radius: 0px; } @media(max-width: 767px) { .header-slider-search .line-form .abs-right button { height: 38px; /* 手机时的高度 */ } } .header-slider-search .line-form .abs-right .icon{ color:#fff; }

自定义js

document.addEventListener("DOMContentLoaded", function () {
const button = document.querySelector(".search-input-text .abs-right button.null");
if (button) {
const searchText = document.createElement("span");
searchText.textContent = "搜索";
searchText.classList.add("search-text");
button.appendChild(searchText);
}
});
document.addEventListener("DOMContentLoaded", function () {
    const button = document.querySelector(".search-input-text .abs-right button.null");
    if (button) {
        const searchText = document.createElement("span");
        searchText.textContent = "搜索";
        searchText.classList.add("search-text");
        button.appendChild(searchText);
    }
});
document.addEventListener("DOMContentLoaded", function () { const button = document.querySelector(".search-input-text .abs-right button.null"); if (button) { const searchText = document.createElement("span"); searchText.textContent = "搜索"; searchText.classList.add("search-text"); button.appendChild(searchText); } });
------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

------关注微信公众号:胖大海TuT------
© 版权声明
THE END
喜欢就支持一下吧
点赞733 分享
Living without an aim is like sailing without a compass.
生活没有目标,犹如航海没有罗盘。
评论 抢沙发

请登录后发表评论

    暂无评论内容