Standard webpage: use dl, dd, and dt of CSS as forms

Source: Internet
Author: User

Yesterday I made a form and still used the table layout, because I personally feel that the table layout form is good (pursuing div refactoring is not equal to completely abandoning the table ).
When I got up this morning, I thought it was another way to layout the form. Then we chose dl, dd, and dt, as shown below:
XHTML section:

The code is as follows: Copy code
<Dl>
<Dt> Company name: </dt>
<Dd> <input name = "text" type = "text" value = "Guangzhou Junbao Industrial Co., Ltd." size = "50"/> <span class = "red"> * </span> </dd>
<Dt> Company industrial Category: </dt>
<Dd> <select name = "select"> <option> computer and consumer electronics </option> </select>
<Select name = "select"> <option> air conditioner </option> </select> <span class = "red"> * </span> </dd>
<Dt> Company Profile: </dt>
<Dd> <textarea name = "textarea" cols = "100" rows = "9"> Founded in 1990, Guangzhou Junbao Industrial Co., Ltd, it integrates scientific research, manufacturing, sales, and service, it is a large-scale economic entity with research and development center, mold design and manufacturing center, electronic and circuit control design and manufacturing center, injection processing and product whole machine production base. Junbao's production base covers an area of approximately 30000 m² square meters and has excellent equipment and powerful production capabilities. In accordance with the specifications and management of modern enterprises, the company adheres to the spirit of integrity, innovation, diligence, and enterprising, and continues to grow and grow.
Junbao has a talent collection, with 326 employees and R & D staff... </textarea> <span class = "red"> * </span>
</Dd>
</Dl>

CSS section:

The code is as follows: Copy code
Dl {padding-left: 14px ;}
Dt {float: left; font-weight: bold; padding: 12px 0 4px ;}
Dd {text-align: left; height: auto; padding: 8px 0 ;}
Input, select {vertical-align: middle; color: #333333; background: # ffffff; font: 12px Arial, Helvetica, sans-serif ;}
Textarea {color: #333333; background: # ffffff; font: 12px Arial, Helvetica, sans-serif; line-height: 150%; overflow: auto}

Note: We recommend that you do not use height or line-height for dl, dt, or dd settings. If FF is used, the deviation may occur because IE and FF are adaptive, we recommend that you use the padding attribute of dt and dd to locate it!

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.