Create a form with css and experience the affinity

Source: Internet
Author: User

Forms are frequently used. However, when building a web standard website, his layout is often forgotten. When it comes to practical use, I find it a headache. Of course, I have also encountered it. Now I want to introduce a method for creating beautiful and specific forms with the <fieldset> </label> label.

Reference content is as follows:

Basic xHTML:

<H3> Registered User Logon <Form action = "" method = "post" name = "apLogin" id = "apLogin">
<Fieldset>
<Legend> User Logon </legend>
<Div>
<Label for = "Name"> User Name </label>
<Input type = "text" name = "Name" id = "Name" size = "18" maxlength = "30"/> <br/>
</Div>
<Div>
<Label for = "password"> password </label>
<Input type = "password" name = "password" id = "password" size = "18" maxlength = "15"/> <br/>
</Div>
<Div class = "cookiechk">
<Label> <input type = "checkbox" name = "CookieYN" id = "CookieYN" value = "1"/> <a href = "#" title = "select whether to record your information "> remember me </a> </label>
<Input name = "login791" type = "submit" class = "buttom" value = "login"/>
</Div>
<Div class = "forgotpass"> <a href = "#"> have you forgotten your password? </A> </div>
</Fieldset>
</Form>

After reading the code, we found that the label description is in <label> </label>. Just make the <label> </label> label floating left alignment, the <div> clear float contained in fieldset can achieve the common layout.

Below is the basic CSS:

<! DOCTYPE <a href =" http://www.blue1000.com/bkhtml/c22/ "_ Fcksavedurl =" http://www.blue1000.com/bkhtml/c22/ "Title =" HTML/JavaScript tutorial "> HTML </a> PUBLIC"-// W3C // dtd x <a href =" http://www.blue1000.com/bkhtml/c22/ "_ Fcksavedurl =" http://www.blue1000.com/bkhtml/c22/ "Title =" HTML/JavaScript tutorials "> HTML </a> 1.0 Strict/EN "" http://www.w3.org/TR/x <A href =" http://www.blue1000.com/bkhtml/c22/ "_ Fcksavedurl =" http://www.blue1000.com/bkhtml/c22/ "Title =" HTML/JavaScript tutorial "> HTML </a> 1/DTD/x <a href =" http://www.blue1000.com/bkhtml/c22/ "_ Fcksavedurl =" http://www.blue1000.com/bkhtml/c22/ "Title =" HTML/JavaScript tutorial "> HTML </a> 1-strict.dtd"> <a href =" http://www.blue1000.com/bkhtml/c22/ "_ Fcksavedurl =" http://www.blue1000.com/bkhtml/c22/ "Title =" HTML/JavaScript tutorial "> HTML </a> <a href =" http://www.blue1000.com/bkhtml/c21/ "_ Fcksavedurl =" http://www.blue1000.com/bkhtml/c21/ "Title =" XML tutorial "> XML </a> ns =" http://www.w3.org/1999/x <A href =" http://www.blue1000.com/bkhtml/c22/ "_ Fcksavedurl =" http://www.blue1000.com/bkhtml/c22/ "Title =" HTML/JavaScript tutorial "> HTML </a>"> 

Run code Copy code Save code Add to favorites

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.