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

温馨提示:本文最后更新于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 分享
You must try things that may not work. And you must not let anyone define your limits because of where you come from. Your only limit is your soul.
千万不要怕失败,也不要因为出身低就让别人限制了你的发展,成败在于你自己。
评论 抢沙发

请登录后发表评论

    暂无评论内容