<!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" lang="utf-8">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>图片居中文字居左</title>
<style type="text/css">
.aaa{float:left;width:650px;text-align:left;}/*外面的层向左浮动,宽度为650像素,文字水平居左*/
.aaa img{text-align:center;display:block;margin:0 auto;}/*层里面的图片,文字水平居左,块状,上下外边距为0,左右外边距自适应*/
</style>
</head>
<body>
<div class="aaa">
123
<img src="http://img.baidu.com/img/logo-zhidao.gif" />
456
</div>
</body>
</html> |