注册 登录
编程论坛 WEB前端(UI)

高手帮我解决下这段css代码。半天不知道那里出错了。

pds635343 发布于 2010-12-03 16:18, 897 次点击
程序代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.>
<html xmlns="http://www.>
<html>
<head>
<title>11111</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style type="text/css">
/*--全局样式样式--*/
body,ul,ol,li,h1,h2,h3,img,div
{margin:0;padding:0;border:0;}
body
{ font-family:Arial, "宋体"; font-size:12px; background:#fff; color:#000;}
ul,ol
{list-style-type: none;}
.L_folat
{ float:left;}.R_float{ float:right; }
em
{font-style:normal;}
/*--内容样式--*/
.container
{width:958px; margin:100px auto 0;}
.bbsImg
{ float:left; width:357px; background:#FF0; height:341px;}
#topForums
{ float:right; width:594px;}
#topForums #ranking
{ height:40px; position:relative;border:#9cc solid 1px;}
#topForums #ranking h3
{ position:absolute;left:18px;top:10px; color:#1e50a2;}
#topForums #ranking ul
{ position:absolute;top:8px;right:70px;}
#topForums #ranking ul li
{ display:inline; color: #1e50a2; margin:20px; font-size:14px;}
#topForums #rankingInfo
{ height:300px; border-right:1px solid #ccc; border-left:1px solid #ccc;border-bottom:1px solid #ccc; padding-top:3px;}
#topForums #rankingInfo #rankingText
{ height:295px; padding:7px 5px 0 5px;}
#topForums #rankingInfo #rankingText ul
{ width:272px;padding:5px 5px 5px 8px;}
#topForums #rankingInfo #rankingText ul li
{ line-height:25px; height:27px; border-bottom:1px dotted #ccc;}
#topForums #rankingInfo #rankingText ul li em
{ margin:0 5px 0 0;}
#topForums #rankingInfo #rankingText ul li em
{ background:#60F; color:#fff;  }
#topForums #rankingInfo #rankingText ul li span
{ color:#F63;}
</style>
</head>
<body>
<div class="container">
      <div class="bbsImg"></div>
      <div id="topForums">
        <!--论坛排行标题-->
        <div id="ranking">
            <h3>论坛排行</h3>
            <ul>
                <li>热帖排行</li>
                <li>新帖排行</li>
            </ul>

        </div>
        <div id="rankingInfo">
            <div id="rankingText">
                <ul class="L_folat">
                         <li><span class="R_float">千里走单</span><em>1</em>111</li>
                         <li><span class="R_float">xiaoshua</span><em>2</em>2222</li>
                         <li><span class="R_float">小福星</span><em>3</em>3333</li>
                         <li><span class="R_float">就当没来</span><em>4</em>111</li>
                         <li><span class="R_float">胖子仐</span><em>5</em>111</li>
                         <li><span class="R_float">雪豆儿</span><em>6</em>111</li>
                         <li><span class="R_float">梦醒时光</span><em>7</em>111</li>
                         <li><span class="R_float">蒙古小烧</span><em>8</em>111</li>
                         <li><span class="R_float">乐居网友</span><em>9</em>111</li>
                         <li><span class="R_float">佳佳沐</span><em>10</em>111</li>
               </ul>
            </div>
        </div>           

  </div>
</body>
</html>

5 回复
#2
pds6353432010-12-03 16:20
回复 楼主 pds635343
ul下第10段代码的em背景是好的 但是前面前面的em的背景颜色怎么都变形了,那里出现错误了。先谢谢了
#3
rabbit_1232010-12-03 18:00
css写的没错,不是变形了,而是那个em对象内容就那么大,1,2,3...改为01,02,03...可以看看效果,或是把10改成三位数的看看吧
#4
pds6353432010-12-04 11:24
那要是我在改变em的宽度。要在改动哪里的样式?我在em样式里设置了高度和宽度怎么没效果啊?
#5
aspic2010-12-04 15:24
#topForums #rankingInfo #rankingText ul li em{margin:0 5px 0 0;background:#60F;color:#fff;width:16px;display:block;float:left;text-align:center}
#6
pds6353432010-12-04 22:22
灰常感谢
1