Home > Web Front-end > HTML Tutorial > Newbie asking for help, page centering problem_html/css_WEB-ITnose

Newbie asking for help, page centering problem_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:17:53
Original
885 people have browsed it

I want an image to be centered on a newly opened page,




This does not fully satisfy


Reply to discussion (solution)

margin:0 auto;text-align:center;

Try this:

<style>html,body{ margin: 0; padding: 0; height: 100%; }body{ position: relative; }.msg{ position: absolute; left: 50%; top: 50%; width: 400px; height: 400px; margin: -200px 0 0 -200px; }.msg img{ display: block; }</style>
Copy after login

body {text-align:center;}
#iframeDiv{margin:0 auto;}

<div id="iframeDiv" style="text-align:center;" >   <img src="<%=basePath %>${request.fileSRC}"></div>
Copy after login

Just use the table, it will be absolutely centered.




< ;td>

Just use the form, it will be absolutely centered.




< ;td>

<div style="margin:auto;width: 100px;height: 100px;">   		<table  style="vertical-align:middle;width: 100px;height: 100px;">     		<tr><td>放图片</td></tr>    	</table>	</div> 
Copy after login

body{text-align:center;}

margin:auto;
text-align:center ;

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template