如何在同一“行”上的两个div块居中?
第一格:
<div id=bloc1><?php echo " version ".$version." Copyright © All Rights Reserved."; ?></div>
第二个div:
<div id=bloc2><img src="..."></div>
CSS:
#block_container { text-align:center; } #bloc1, #bloc2 { display:inline; }
HTML
<div id="block_container"> <div id="bloc1"><?php echo " version ".$version." Copyright © All Rights Reserved."; ?></div> <div id="bloc2"><img src="..."></div> </div>
另外,您不应将原始内容放入中<div>,而应使用诸如<p>或的适当标签<span>。
<div>
<p>
<span>