希望高手帮个忙看看怎么改CSS代码:#top1
{
WIDTH:
969px}/*---------------------页面基础定义----------------------------------*/body,td,th
{
font-family:
Tahoma,
Verdana,
Arial,
sans-serif
font-size:
12px
color:
#000000}body
{
margin-left:
0px
margin-top:
0px
margin-right:
0px
margin-bottom:
0px}/*---------------------链接定义----------------------------------*/a
{
color:
#FFFFFF
text-decoration:
none}a:hover
{
color:
#000000
text-decoration:
none}a:active{
color:
#FF0000
text-decoration:
none}/*---------------------菜单样式----------------------------------*/#menu{
height:32px
margin-top:1px
background-color:#90D311}#menu
ul{
margin:auto
width:778px
height:32px
list-style-type:none
padding:0px
margin-top:0px
margin-bottom:0px}.m_li{
float:left
width:88px
line-height:32px
text-align:center
margin-right:-2px
margin-left:-2px}.m_li
a:link{
display:block
color:#FFFFFF
width:85px}.m_line{
float:left
width:1px
height:32px
line-height:32px
/*ff下有效(图片垂直居中)*/}.m_line
img{
margin-top:expression((
32
-
this.height
)
/
2)
/*ie下有效(图片垂直居中)*/}.m_li_a{
float:left
width:85px
line-height:32px
text-align:center
padding-top:3px
font-weight:bold
background-image:url(
http://127.0.0.1/daohang/images/menu_bg.JPG
)
position:relative
height:32px
margin-top:-3px
margin-right:-2px
margin-left:-2px}.m_li_a
a{
display:block
color:#FF0000
width:85px}.smenu{
width:810x
margin:0px
auto
0px
auto
padding:0px
list-style-type:none
height:32px
FLOAT:
left}.s_li{
line-height:32px
FLOAT:
left
width:auto
display:none
height:32px
}.s_li_a{
line-height:32px
width:auto
display:block
height:32px
FLOAT:
left}
<title>Document</title><style>
table tr td:nth-child(1){color:red}
</style>
</head>
<body>
<!-- 用css3选择器 -->
<table>
<tr>
<td>11111111</td>
<td>2222222222</td>
</tr>
</table>
控制字体位置可以用padding margin text-indent 单位可以是px em % (em是根据你设置的字体大小设定的,假如你设置字体为12px,那么2em就是24px。 %是根据父容器的宽度或高度决定的。margin-left:automargin-right:auto(左右自动对齐)。position:absolute(绝对定位)