div对齐样式

来源:百度知道 编辑:UC知道 时间:2024/06/11 07:25:58
<table width="300" border="1" bordercolor="#CCCCCC">
<tr>
<td><div ID="" class="index">
<ul>
<li><a href="">测试</a> <span class="index2">测试二</span></li>
</ul>
</div></td>
</tr>
</table>
如上题,应怎么写index和index2的样式,达到测试和测试二分别相对于表格在同一行靠左右两边对齐

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
font-family: 宋体;
font-size: 12px;
}
#index{ width:900px; margin-left:auto; margin-bottom:0px; margin-right:auto; margin-top:0px; position:relative; visibility:visible;}
#index ul{ margin:0px; padding:0px; border:none; list-style-