Home > Web Front-end > HTML Tutorial > How to center the value inside vertically and horizontally. _html/css_WEB-ITnose

How to center the value inside vertically and horizontally. _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:21:29
Original
2771 people have browsed it

<form id="sendemail">				<fieldset id="set"> 					<label> emial address</label><br>					<input type="text" name="email" value="Enter email..."/><br>					<input type="submit" name="send" value="send"/>				</fieldset>			</form>
Copy after login

How to center the value in vertically and horizontally.


Reply to discussion (solution)

You can use margin-left, margin-top to adjust.

I know, add an attribute: display:block;

Well, block attribute~

I know, add an attribute: display:block; But this setting Not so much with height. So how can we make both and right-aligned. Set text-align:right in the form. It is OK in ie, but it is displayed on the left in ff.
Post my code for help:

<form id="sendemail">								    <input type="text" name="email" value="Enter email..."/> <br>					<input type="submit" name="send" value="send"/>				 			</form>
Copy after login

#sendemail {	position:absolute;	top:180px;	right:60px;	margin-top:10px;	text-align: right;} #sendemail input[type="text"]{	width: 217px;	height:25px;	line-height:25px;	vertical-align: middle;	border:1px solid black;	margin-bottom:10px;}#sendemail  input[type="submit"] {		width:75px;	display: block;}
Copy after login

Yes, I am also encountering a similar problem at the moment, which is to let the value attribute in the input tag The value is displayed in the center of the input box. .

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