关于网站头部搜索框宽度调整
2017-03-21 17:14:29
yedada
  • 访问次数: 70
  • 注册日期: 2014-04-21
  • 最后登录: 2021-08-26

当导航菜单过长而欲加搜索框在一行时,官方默认搜索框宽度调整,从all.css找到以下



/* Search bar */

#searchbar {max-width: 200px;}
.m-blog #searchbar, #header.compatible #searchbar {position: absolute; right: 0; top: 45%;}
#searchbar .input-group {position: relative;}
#searchbar .form-control {border-radius: 16px; padding-right: 30px;}
#searchbar .btn {position: absolute; right: 0; top: 1px; z-index: 10; border: none; box-shadow: none; background: none; color: #808080}
#searchbar .btn:hover {color: #347aeb}
@media (max-width: 767px) {
  #header.compatible #searchbar {right: auto; left: 0; top: 2px; max-width: 150px}
  #searchbar .form-control, #searchbar .btn {padding: 3px 8px; height: 26px}
  #searchbar .btn {padding: 3px; right: 5px; top: 1px;}
  #headNav.hide {display: block; height: 30px}

  #headNav.hide + #searchbar {max-width: 400px; left: auto; right: 0; padding: 0 10px;}



不管是从all.css文件直接修改宽度,还是从后台-设计-代码管理-全部页面-加载css调整 都不起作用

如修改为:

.testClass{ 
color:blue !important; 

.testClass{ 
color:red; 
#searchbar {max-width: 20px;}
}

希望有官方或高手给予指点!

沙发
2017-03-21 17:27:25
yedada
  • 访问次数: 70
  • 注册日期: 2014-04-21
  • 最后登录: 2021-08-26
又:官方本站上面导航菜单加搜索,做得挺好,就是不知道这个搜索框从哪可以调整?
板凳
2017-03-21 17:38:03
纪鲁
  • 访问次数: 685
  • 注册日期: 2014-08-01
  • 最后登录: 2020-04-04
检查自己写的css是否正确,学会使用浏览器的开发人员工具
#3
2017-03-22 09:22:54
yedada
  • 访问次数: 70
  • 注册日期: 2014-04-21
  • 最后登录: 2021-08-26

经检查,正确代码如下:

div#searchbar{
    width: 40px !important;
}

1/1
联系我们

联系人:ZSITE交流群

电话/微信:

Email:

QQ:

地址:青岛市黄岛区井冈山路157号中南金石国际广场A座3205室