我正在使用這個CSS。但是,隨着IE7和IE8不支持nth child
所以我想用jQuery做它,所以它在所有的瀏覽器如何將css解釋爲jQuery?
#localFileCopyingDiv, #supplementaryMaterialsDiv, #assetsDiv, table tr td:nth-child(1 /*this is the column number*/){
text-align: center;
width:30px
}
#localFileCopyingDiv, #supplementaryMaterialsDiv, #assetsDiv, table tr td:nth-child(2 /*this is the column number*/){
width:250px
}
#localFileCopyingDiv, #supplementaryMaterialsDiv, #assetsDiv, table tr td:nth-child(3 /*this is the column number*/){
width:250px
}
#localFileCopyingDiv, #supplementaryMaterialsDiv, #assetsDiv, table tr td:nth-child(4 /*this is the column number*/){
width:60px
}
#localFileCopyingDiv #supplementaryMaterialsDiv, #assetsDiv table tr td:nth-child(5 /*this is the column number*/){
width:220px
}
#courseInfoDiv table tr td:nth-child(1 /*this is the column number*/){
width: 200px;
}
#courseInfoDiv table tr td:nth-child(2 /*this is the column number*/){
width: 600px;
}
我如何轉換上面提到的CSS到jQuery的工作嗎?
感謝
編輯: ----------------------------------- ---------
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Status Report</title>
<script type="text/javascript" src="javascript/jquery-1.9.1.min.js"></script>
<!--[if (gte IE 6)&(lte IE 8)]>
<script type="text/javascript" src="javascript/selectivizr-min.js"></script>
<noscript><link rel="stylesheet" href="brands/default/en/css/exportComplete.css" /></noscript>
<![endif]-->
<script type="text/javascript" src="javascript/jquery-migrate-1.2.1.js"></script>
<link rel="stylesheet" type="text/css" href="brands/default/en/css/exportComplete.css" />
</head>
可以嗎?
您是否動態添加了一些受css規則影響的內容? –
你可以考慮這個解決方案: http://stackoverflow.com/questions/8492121/ie8-nth-child-and-before – AllWorkNoPlay
www.jquery.com閱讀文檔。 –