好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

让图片img标签在div里上下左右居中的方法


复制代码

代码如下:


<!DOCTY PE ht ML P ub LIC "-//W3C//DTD XHTML 1.0 Trans IT ional//EN" "http://www.w3. org /TR/xhtml1/DTD/xhtml1 -t ransitional.dtd">
<html XM lns="http://www.w3.org/1999/xhtml">
<head>
< ;m eta n am e="author" type="Nancle From CAU CS101" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>如何让 img 标签在div里左右上下居中</title>
<script type="text/javascript">
</script>
<style type="text/css">
# cont ai ner{width:400px; h ei ght:400px; background:#ccc; text-align: center ;}
img{m@R_ 512 _2604@in:100px auto 0 auto;}
</style>
</head>
<body>
<div id="container">
<img src="http://img.my.csdn.net/uploads/201207/14/1342258377_8375.png" width="200" height="200" />
</div>
<p>
</p>
</body>
</html>

总结

以上是 为你收集整理的 让图片img标签在div里上下左右居中的方法 全部内容,希望文章能够帮你解决 让图片img标签在div里上下左右居中的方法 所遇到的问题。

如果觉得 网站内容还不错, 推荐好友。

查看更多关于让图片img标签在div里上下左右居中的方法的详细内容...

  阅读:18次