Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

调节主导航菜单的宽度

[复制链接]
ziyuenet 发表于 2011-1-22 15:18:57 | 显示全部楼层 |阅读模式
本帖最后由 ziyuenet 于 2011-6-29 20:39 编辑

经常会遇到主导航菜单很多,一排放不下的情况,其实可以减小导航菜单的宽度,这样就可以容纳更多的导航菜单了。

下面是针对X1.5的修改方法:

需要修改样式表文件:\template\default\common\common.css文件

打开该文件,找到下面红色的部分,默认值是:20,你可以相应的减少该数值,就可以缩短导航菜单的宽度了!

/* 页头 */
#hd { margin-bottom: 10px; border-bottom: {HEADERBORDER} solid {SPECIALBORDER}; {HEADERBGCODE} }
  #hd .wp { padding: 10px 0 0; }
   #diy-tg { position: absolute; top: 0; right: 15px; z-index:100; }
   /*.hdc { border-bottom: {HEADERBORDER} solid #005DC3; }*/
   .hdc { position: relative; z-index: 3; min-height: 70px; background: {HEADERBGCOLOR}; }
    .ie6 .hdc { height: 70px; }
   #hd h2 { padding: 0 20px 8px 0; float: left; }
    #space #hd h2 { margin-top: 0; }
   #hd .fastlg { position: absolute; bottom: 8px; right: 0; }
   #scbar { overflow: hidden; height: 36px; line-height: 36px; background: url({IMGDIR}/search.gif) repeat-x 0 0; }
    #scbar table { background: url({IMGDIR}/search.gif) no-repeat 0 -36px; }
     #scbar td { padding: 0 2px; white-space: nowrap; }
    #scbar #srchtxt { margin-top: 2px\9; margin-right: 10px; margin-left: 35px; width: 250px; height: 18px; line-height: 18px; border: none; background: transparent; outline: none; }
    #scbar label { margin-right: 8px; cursor: pointer; }
    #scbar #search_submit { width: 51px; height: 36px; border: none; background: transparent url({IMGDIR}/search.gif) no-repeat 0 -77px; cursor: pointer; }
    #scbar .hot { padding-left: 1em; }
     .ie6 #scbar .hot { white-space: normal; }
   #sc td { padding: 0 3px; }
    #srchtxt { font-size: 12px; line-height: 22px; }
     .ie6 #srchtxt { line-height: 20px; }
    #sc #search_submit { width: 51px; height: 32px; border: none; background: transparent url({IMGDIR}/search.gif) no-repeat 0 -79px; cursor: pointer; }
    #sctype_menu { width: 100px; }
     #sctype_menu input { position: absolute; width: 0; height: 0; opacity: 0; }
     #sctype_menu a { padding: 0; }
     #sctype_menu label { display: block; padding: 3px 15px; line-height: 1.5; cursor: pointer; }
   #nv { overflow: hidden; padding-left: 3px; height: 33px; {MENUBGCODE}; }
    #nv li { float: left; padding-right: 1px; height: 33px; line-height: 33px; background: url({IMGDIR}/nv_a.png) no-repeat 100% 0; font-weight: 700; font-size: 14px; }
     .ie_all #nv li { line-height: 36px; }
     .ie6 #nv li { line-height: 33px; }
     #nv a { float: left; padding: 0 20px; height: 33px; }
      #nv a { color: {MENUTEXT}; }
      #nv li span { display: none; }
     #nv li.a { margin-left: -1px; {MENUHOVERBGCODE}; }
      #nv li.a a { color: {MENUHOVERTEXT}; }





下面是针对X2.0的修改方法:

需要修改样式表文件:\template\default\common\common.css文件

#nv { overflow: hidden; padding-left: 3px; height: 33px; {MENUBGCODE}; }
    #nv li { float: left; padding-right: 1px; height: 33px; line-height: 33px; background: url({IMGDIR}/nv_a.png) no-repeat 100% 0; font-weight: 700; font-size: 14px; }
     .ie_all #nv li { line-height: 36px; }
     .ie6 #nv li { line-height: 33px; }
     #nv li a { float: left; padding: 0 20px; height: 33px; }

找到以上代码(在613行),修改红色数字就行了!这是针对默认模板的!

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-28 11:21 , Processed in 0.142378 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表