我有这个html内容:
<div class="test">
<a href=/cgi-bin/source/sourceSearch><img border=0 src=http://source-search.princeton.edu/images/SOURCE/sourcehdrBlue.gif></a>
<h2 style='margin-bottom:0px'>BATCH</h2>
<table border="0" cellpadding="0" width="600">
<tr>
<td><h3>SOURCE is now hosted by Princeton University. The supporting database was last updated on June 10, 2015. </h3> <p>This page is the batch extract interface for SOURCE. You can input a list of GenBank Accessions, dbEST cloneIDs, UniGene ClusterIDs, UniGene gene names, UniGene gene symbols microarray Probes from various platforms (Affymetrix, Agilent, Heebo/meebo, Illumina) or coordinates (e.g.: chr1 14565 15000 - chromosome, from, to - one set per line) and retrieve data from the checklist below. You will be given a link to the output file when processing is complete.</p> <p>You may enter the identifiers as a file or as a list in the text area below. If you are entering an input file, it must be a text file consisting of a single column containing one of the accepted types of identifiers.</p> <p>Please see the <a href="http://source-search.princeton.edu/help/SOURCE/resultsBatchHelp.html">help</a> section for further information. Or go to <a href="http://source-search.princeton.edu/cgi-bin/source/sourceSearch">Single Entry SOURCE Search.</a> </p></td>
</tr>
</table>
</div>
只需添加<center>... </center>
所有这些代码,这就是我想要的。由于<center>
标记已在HTML中弃用,因此我想使用CSS而不是<center>
。我的CSS代码是这样的:
div.test {
margin-left: auto;
margin-right: auto;
text-align: center;
}
我尽了我所能找到的一切,但所有这些都不对我有用。我使用Windows 7和chrome,我已经看到为什么HTML中不推荐使用<center>标记?和Simple可以使一个没有CSS且没有CSS的对象居中。
您使用它是有原因的<table>
吗?
改变你的CSS:
div.test {
text-align: center;
}
div table{
margin: 0 auto;
}
小提琴
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句