关于导航条层上内容居中问题

lockywing 2013-03-07 10:32:57
/*** 导航样式 Begin ***/
.main_nav {
BACKGROUND: url(images/sprites_bg.gif) repeat-x 0px -195px; WIDTH: 100%; HEIGHT: 34px;
}
.navList {
MARGIN: 0px auto; WIDTH: 980px;
}
.navList LI {
BACKGROUND: url(images/sprites_bg.gif) no-repeat 0px -240px;
PADDING-TOP: 2px;
PADDING-LEFT: 9px;
FLOAT: left;
TEXT-ALIGN: center;
FONT-SIZE: 30px;
WIDTH: 75px;
HEIGHT: 30px;
}
.WIDTH: 100%;
DISPLAY: block; FILTER: dropshadow(Color=#000000,OffX=1, OffY=1);
WIDTH: 100%;
COLOR: #ffffff;
LINE-HEIGHT: 30px; HEIGHT: 29px
}
.navList LI A:hover {
COLOR: #ffff00;
TEXT-DECORATION: none
}
.indexpage A , .indexpage A :link, .indexpage A:visited, .indexpage A :hover, .indexpage A:active {
text-decoration: none; font-size: 14px;
}
.none A , .none A :link, .none A:visited, .none A :hover, .none A:active {
text-decoration: none; font-size: 14px;
}
LI.toppage A, .toppage A, .toppage A :link, .toppage A:visited, .toppage A :hover, .toppage A:active {
color: #00FFFF; text-decoration: none; font-size: 14px;
}
.navList LI.toppage A { color: #00FFFF; }
/*** 导航样式 End ***/

导航条上面的内容字体是居中的,由于内容很少,所以想在导航条上居中,弄了好久搞不定,求大神指点
...全文
122 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
lockywing 2013-03-11
  • 打赏
  • 举报
回复
例如 首页 组织机构 活动介绍 之类的,只是想让这几个名目在导航条中间对齐表现出来 这里是style.css一部分的代码 @charset "utf-8"; /* CSS Document */ body { background:url(../images/body_bg.png);} #toolbar{height:25px;line-height:25px; background:#000;} #toolbar div {width:930px; margin:0 auto; color:#ffc400;} #toolbar a{color:#ffc400;} #toolbar div ul li.favor {background:url(../images/icon_favor.jpg) no-repeat left 6px; padding-left:18px;} #toolbar div ul li.user{color:#A10000; } #banner { height:138px; border-bottom:1px solid #fa8749; background:url(../images/show/banner.png) no-repeat 50% 0; } .banner_bg {background:url(../images/show/banner_bg.jpg) repeat-x;} .banner_bg div {margin:0 auto; width:970px; position:relative;} .banner_bg div p{position:absolute; top:115px; right:73px; color:#e9e9e9; font-weight:bold;} .banner_bg div p a, .banner_bg div p a:visited {color:#e9e9e9; font-weight:normal; text-decoration:none;} .banner_bg div p a:hover {color:#e9e9e9; font-weight:normal; text-decoration:underline;} #nav { height:42px; border-bottom:1px solid #400801; background:url(../images/nav_bg.png) repeat-x; font-size:14px;} #nav ul { width:940px; padding-left:20px; height:42px; margin:0 auto;} #nav li { float:left; display:inline; margin:6px 20px 0; height:28px; line-height:28px; padding-left:20px;} #nav li span { display:inline-block; height:28px; padding-right:20px; } #nav li.cur { background:url(../images/nav_menu.png) no-repeat 0 0;} #nav li.cur span {background:url(../images/nav_menu.png) no-repeat right 0;} #nav li.cur a , #nav li.cur a:visited { font-weight:bold; color:#fafafa;} #nav li.cur a:hover { text-decoration:none;} #nav a , #nav a:visited {color:#ffc400;} .area_tit h3 span a{margin-right:10px; color:#FFF; font-size:12px; font-weight:normal;} #subNav { height:40px; background:url(../images/subNav_bg.png) repeat-x; color:#ffc400;} #subNav dl { width:960px; margin:0 auto; padding-top:12px;} #subNav dt , #subNav dd { float:left; display:inline;} #subNav dt { margin-left:50px; font-weight:bold;} #subNav dd { overflow:hidden;} #subNav span { margin-left:-1px; padding:0 8px; border-left:1px solid #666;} #subNav a , #subNav a:visited { color:#ffc400;} #subNav a.area_on {font-weight:bold; color:#FFFF92} #main { width:976px; margin:0 auto 20px; background:#fff url(../images/main_bg.png) repeat-y;} .main_bottom { clear:both; height:6px; font-size:0; line-height:0; background:url(../images/main_bottom_bg.png) no-repeat;} .colLeft { float:left; display:inline; width:700px; margin-left:13px;} .colRight { float:right; display:inline; width:230px; margin-right:13px;} #slider { margin:10px 0 0 0;} #slides { width:308px; margin:10px 0 0 0; border:1px solid #666;} .slides_container { width:308px; overflow:hidden;} .caption { position:absolute; width:308px; height:35px; background:url(../images/caption_bg.png) no-repeat; font-size:14px; font-weight:bold; color:#fafafa; font-family:arial; text-align:center; line-height:35px; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/caption_bg.png', sizingMethod='scale'); _background:none;} .pagination { background:#000; height:30px; padding-left:100px;} .pagination li { float:left; display:inline; width:15px; height:15px; margin:8px 6px 0; line-height:0; font-size:0; background:url(../images/pagination.png) no-repeat;} .pagination li a { display:block; width:15px; height:15px;} .pagination .current { background-position:0 -15px;} #news { width:370px; margin:10px 0 0 0;} #news div { padding:0 10px;} .news_tit { height:24px; text-align:right;} .news_tit strong { float:left; font-weight:bold; font-size:14px;} .news_top { border-bottom:1px dotted #999;} .news_top h2 {text-align:center;} .news_top h2 a , .news_top h2 a:visited { font-weight:bold; font-size:18px; color:#cc0000;} .news_top p { padding:5px 0 10px 0; color:#666;} .news_top p a , .news_top p a:visited , .news_top p span { color:#cc0000;} .news_list { padding:0; padding-top:0px; padding-left:10px;} #formWrap .news_list h3 {font-size:21px; color:#c00; font-weight:bold;} .news_list li {line-height:26px; height:26px; font-size:14px;position:relative;} .news_list .time {position:absolute;top:0px; right:0px; color:#999} .stage { margin:10px 0 0 0;} .wz{float:left; padding:10px 0;} .wz dl{width:680px; height:auto; float:left;} .wz dl dt{width:650px; height:auto; float:left; line-height:30px; padding-left:30px; text-align:left; font-size:16px; font-weight:bold; color:#000; background:url(../images/stars.jpg) 5px 4px no-repeat; border-top:#ACACAC dotted 1px; margin-top:5px; margin-bottom:5px;} .wz dl dt.wu{border:none;} .wz dl dd{width:610px; height:auto; float:left; line-height:24px; text-align:left; font-size:14px; color:#666666; padding:0 30px;} .networkList { padding:5px;} .networkList h3{background:url(../images/stars.jpg) no-repeat left top; height:18px; padding-left:30px; padding-top:2px; font-size:14px; font-weight:bold;} li.padding_top_10px {padding-top:10px;} .border_dashed_bottom {border-bottom:1px dashed #CCC; margin-bottom:15px;} .networkList ul { overflow:hidden; _zoom:1; padding-bottom:10px;} .networkList li { float:left; display:inline; width:128px; padding:10px 4px; margin-top:-1px; text-align:center; } .networkList li.padding_top_10px {padding-top:10px;} .operators { width:128px; border:1px solid #d8d8d8; text-align:center; background:url(../images/company_list_bg.png) repeat-x 0 bottom;} .operators dt{height:4em;} .operators .pic {text-align:center; vertical-align:middle; margin:4px auto; width:90px; height:120px;} .operators .pic img {vertical-align:middle; text-align:center; margin:0 auto;} .operators dd a , .operators dd a:visited { display:inline-block; width:52px; height:20px; margin:0 3px; line-height:20px; background:url(../images/menu_20110303_01.png) no-repeat;} .operators .vote , .operators .votes { margin:0 4px; line-height:26px;} .operators .vote { padding-bottom:5px; border-bottom:1px solid #eaeaea;} .operators .votes { line-height:26px; border-top:1px solid #fff;} .operators .votes span { font-weight:bold; color:#cc0000;} .box_tit { height:32px; margin-top:0px; background:url(../images/box_tit_bg.png) repeat-x;} .box_tit div { height:32px; background:url(../images/box_tit_right.png) no-repeat right 0;} .box_tit h3 { height:32px; text-indent:-9999px; background:url(../images/box_tit.png) no-repeat;} .sinaBlog .box_tit h3 { background-position:0 -128px;} .bjNetwork {margin-top:10px;} h3.area_title {text-indent:0px; font-size:14px; font-weight:bold; color:#FFF;margin-left:0px; margin-bottom:0px; padding-left:15px; height:32px; line-height:32px; background:url(../images/box_tit_2.png) no-repeat 0 -64px;} .all_ws_title {position:relative; margin-top:15px;} .all_ws_title ul {margint:0; padding:0; margin-top:10px;} .all_ws_title ul li{float:left; margint:0; padding:0; width:104px; height:33px; background:url(../images/prize_title.png) no-repeat; padding-top:5px; margin-right:10px; display:inline;} .all_ws_title ul li a {display:block; width:104px; height:33px; padding:0; margin:0; color:#C00; } .all_ws_title ul li.click_on {background:url(../images/prize_title_on.png) no-repeat;} .all_ws_title ul li a:hover{text-decoration:none;} .all_ws_title ul li.click_on a{ color:#FFF; font-weight:bold; font-size:14px;} .all_ws_line {height:2px; _overflow:hidden; background:#a50b0b; width:678px; position:absolute; top:29px; left:0;}
  • 打赏
  • 举报
回复
说真的 下决心回答这个问题 我很揪心。你说的问题 不明确 内容字体是居中的。导航条上不居中。说真的 我不明白你要什么居中。另外你光贴了样式没有贴 页面也就去算了。你贴的样式也不能贴不全啊。好些 都是不全的。

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧