你需要写一个CSS样式文件,后缀名称就是CSS,我这里正好写了一个CSS样式表,用于定义网站显示文字的格式,然后你复制这个代码将这个代码保存格式为:comman.css
/*------reset------*/
body,dl,dd,ul,ol,h1,h2,h3,h4,h5,h6,p,form{
margin:0;
color: #000;
font-size: 12px;
font-family: "微软雅黑";
text-align: center;
}
body,button,input,select,textarea{font:12px/1.5 tahoma,'\5b8b\4f53',sans-serif;color:#6c6c6c;}
body{padding-top:42px;}
h1,h2,h3,h4,h5,h6{font-size:100%;}
em,i,b{font-style:normal;}
ul,ol{list-style:none;}
a{color:#6c6c6c;text-decoration:none;}
a:hover{
color:#330033;
font-size: 12px;
text-align: left;
}
img{border:0;}
button,input,select,textarea{font-size:100%;outline:none;vertical-align:middle;}
textarea{resize:none;}
table{
border-collapse:collapse;
border-spacing:0;
text-align: center;
}
td,th,ul,ol{
padding:0;
color: #000;
text-align: center;
font-family: "微软雅黑";
font-size: 12px;
}
/*------common------*/
.pr{position:relative}
.pa{position:absolute}
.fl{float:left}
.fr{float:right}
.fl,.fr{display:inline}
.bc{margin-left:auto;margin-right:auto}
.cb{clear:both}
.db{display:block}
.clearfix{*zoom:1}
.clearfix:after{content:'\20';display:block;height:0;line-height:0;visibility:hidden;clear:both}
.tc{text-align:center}
.tr{text-align:right}
.fb{font-weight:bold}
.fn{font-weight:normal}
.f16{font-size:16px}
.f14{font-size:14px}
.f_yh{font-family:'\5FAE\8F6F\96C5\9ED1'}
.ell{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;}
.none{display:none}
.hidden{visibility:hidden;}
.ht{overflow:hidden;text-indent:-9999px;text-decoration:none}
.unl{text-decoration:underline}
.bd1{border:1px solid #d8d8d8;}
.bd1-t{border-top:1px solid #d8d8d8;}
.bd1-b{border-bottom:1px solid #d8d8d8;}
.bd3{border:3px solid #d8d8d8;}
.hlh30{height:30px;line-height:30px;}
.hlh24{height:24px;line-height:24px;}
.lh22{line-height:22px}
.hlh20{height:20px;line-height:20px;}
.c1{color:#5d5d5d}/*积齥*/
.c2{color:#8f8f8f}/*k*/
.c3{color:#e44cea}/*a?k*/
.c4{color:#f49bff}/*toplink*/
.c5{color:#ff0000}
.bc1{background:#f3f3f3}/*积sk*/
.bc2{background:#f8f8f8}/*齭k*/
.bc3{background:#ffffff}
.mt10{margin-top:10px}
.mb10{margin-bottom:10px}
.mr9{margin-right:9px}
.ml7{margin-left:7px}
.ml89{margin-left:89px}
.p20{padding:20px}
.p10{padding:10px;}
.pt1{padding-top:1px;}
.pr6{padding-right:6px;}
.pl6{padding-left:6px;}
.w230{width:230px}
.spr{background:url(http://ossweb-img.qq.com/images/ktv/web201206/spr.png) no-repeat;overflow:hidden;}
.ico{width:8px;height:8px;line-height:8px;margin:10px 8px 0 8px;}
/*--notice--*/
.game-notice{width:1000px;padding:60px 0 30px 0;}
.game-notice em{padding:0 4px;color:#6c6c6c;}
/*--footer--*/
.footer{
background:#19001a;
color: #FFF;
}
.foot-con{width:915px;padding:20px 0 30px 85px;}
.foot-logo{width:216px;height:45px;border-right:1px solid #3a173b;}
.game-logo{width:107px;height:35px;background-position:0 -232px;}
.kaige-logo{width:93px;height:35px;background-position:-107px -232px;cursor:default;}
.foot-list{padding-left:15px;color:#673768;}
.foot-list a{color:#673768;}
.foot-list a:hover{text-decoration:underline;}
.foot-link{width:578px;}
.foot-link span{padding:0 5px;color:#3A173B;}
.copy{width:576px;}/* |xGv00|8d5f9fb42d5dc8f4155bd7ed0d0073ae */
一般在做导航栏的时候会使用浮动,这样就能将div放到一行里去了
adadsfadf | asdfadsfadsfa
shoucang | shouye | wenda
这是我写的,用的就是浮动
你去了解一下css display的属性,特别是inline,block。
不能放到一行,大多数是因为是block元素,当然,也有可能是因为空间不够。
你把你代码发上来看看