Perfect solution for vertical centering of form elements

Perfect solution for vertical centering of form elements

Copy code
The code is as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Perfect vertical centering of form elements</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>
</head>
<body>
<div class="warp">
<h2>Radio boxes and check boxes are very small and not easy to click, which causes confusion for many users and a poor user experience</h2>
<p>Please see the perfect solution of [A touch of coolness]:

Perfect vertical centering, click on the text to select it, shortcut key to select it, mouse over the text to show hand shape (implying clickable)</p>
<input name="aaa" id="aaa" type="checkbox" value=""/> <label for="aaa">X×I am a perfect checkbox</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">X×I am a perfect radio button</label>

<label for="fff">X×I am a perfect text box</label><input id="fff" type="text"/>

<input name="eee" id="eee" type="checkbox" value=""/><span>Pictures can also be centered</span><img width="270" height="129" usemap="#mp" src="upload/2022/web/baidu_sylogo1.gif"/>
</div>
</body>
</html>

<<:  MySQL slave library Seconds_Behind_Master delay summary

>>:  Implementation steps for enabling docker remote service link on cloud centos

Recommend

How to reasonably use the redundant fields of the database

privot is the intermediate table of many-to-many ...

Vue-Element-Admin integrates its own interface to realize login jump

1. First look at the request configuration file, ...

HTML table markup tutorial (37): background image attribute BACKGROUND

Set the background image for the table header. Yo...

MySQL 5.7.20 compressed version download and installation simple tutorial

1. Download address: http://dev.mysql.com/downloa...

How to reset the root password in mysql8.0.12

After installing the database, if you accidentall...

Detailed explanation of the usage and function of MySQL cursor

[Usage and function of mysql cursor] example: The...

Steps to modify the MySQL database data file path under Linux

After installing the MySQL database using the rpm...

Detailed Example of Row-Level Locking in MySQL

Preface Locks are synchronization mechanisms used...

A brief discussion on several specifications of JS front-end modularization

Table of contents Preface The value of front-end ...

Solution for applying CSS3 transforms to background images

CSS transformations, while cool, have not yet bee...

How to use IDEA to configure tomcat and create JSP files

Before using idea to write JSP files, you need to...

Detailed explanation of Mysql's method of optimizing order by statement

In this article, we will learn about the optimiza...

Vue's vue.$set() method source code case detailed explanation

In the process of using Vue to develop projects, ...