vertically and horizontally."/> vertically and horizontally.">

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
WBOYOriginal
2016-06-24 12:21:292768browse

<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>

How to center the value in 54b28e0e73a12e4a8ed487872a6fb5b8 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 23efcc05e98690ceeb219581933e4231 and 1ca1c62c26abd535ac834bba399b9a95 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>

#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;}

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. .

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