Home >Web Front-end >HTML Tutorial >如何让一张带有链接的图片横竖都居中,显示在页面最中央_html/css_WEB-ITnose

如何让一张带有链接的图片横竖都居中,显示在页面最中央_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:43:131170browse

<div style="text-align:center;">		<a href="index.jsp">			<img src="images/xxx.jpg" alt="点击进入......" border="1">		</a></div>

接下去的垂直居中怎么搞,求大神赐教……


回复讨论(解决方案)

简单的办法你可以使用table。设置vertical-align:middle

line-height:24px;  可以自己设置大小

body里面设置没

<div   style="max-width:90%">		<a href="index.jsp">			<img src="images/xxx.jpg" alt="点击进入......" border="1">		</a></div>

接下去的垂直居中怎么搞,求大神赐教……

参看我刚写的博文:
http://www.cnblogs.com/flyher/archive/2013/05/08/3066563.html

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn