CSS Form element Vertical Center perfect solution

Source: Internet
Author: User

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
<meta http-equiv= "Content-type" Content= "text/html; Charset=utf-8 "/>
<title> form elements perfectly vertically centered </title>
<style type=" Text/css "
*{padding:0; margin:0;}
body{font:14px/1.231 Tahoma, Geneva, Sans-serif; Background-color: #D1D5E7;}
Label{cursor:pointer; vertical-align:middle;}
Input{vertical-align:middle; margin:5px;}
. warp{margin:100px 350px;}
span{vertical-align:middle; text-decoration:underline;}
img{Vertical-align:middle; border:1px solid #CCF; _margin-bottom:1px;}
P{font-size:14px;}
H2{font-size:16px;}
</style>
<body>
<div class= "Warp"
<p> See "A cool" perfect solution:

Perfect Vertical Center, click Text Optional, shortcut key optional, mouse on the text display hand type (hint clickable) </P
<input name= "AAA" id= "AAA" type= "checkbox" value= ""/> <label-for= "AAA" >xx I'm perfect check box </label>

<input name= "CCC" id= "CCC" type= "checkbox" accesskey= "2" value= ""/> <label for= "CCC" > I support keyboard alt+2 selection (<span>2</span>) </label>

<input name= "BBB" id= "BBB" type= "Radio" value= "/><" " Label for= "BBB" >xx I am the perfect radio box </label>

<label for= "FFF" >xx I'm the perfect text box </label><input id= " FFF "type=" text/>

<input name= "eee" id= "eee" type= "checkbox" value= ""/><span> the picture can also be centered </span >
</div>
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.