Front-end HTML forms and CSS styles

Source: Internet
Author: User

1,from Label

  The function of the from tag is to transfer data to the server and implement important tags for user interaction.

Specific use of the FROM tag:

Input Label Use example:

 

 < fromAction=""Method= "POST">        <P>Name:<inputtype= "text"name= "Names"> </P>        <P>User name:<inputtype= "text"name= "username"> </P>        <P>Password:<inputtype= "Password"name= "pwd"> </P>        <P>Hobbies: Cycling<inputtype= "checkbox"name= "Hobby1"checked= "Checked">Game<inputtype= "checkbox"name= "Hobby2">movie<inputtype= "checkbox"name= "Hobby3">        </P>        <P>Man<inputtype= "Radio"name= "Sex">Woman<inputtype= "Radio"name= "Sex"></P>

The first sentence: The action tag means that the form is submitted to the server's link address, method label, indicating that the form is submitted as a post response format

The second sentence: Specify a Name table input label, type indicates that the column uses the format specified in the "text" text format, name specifies that the column passed the value "username"

The checkbox tag means multi-box.

Last sentence: Type is a radio box, followed by the name value is a single option value, specified as the same value.

Multi-level Menu label: Select Label operation
   <Selectname= "Province"size= "2"multiple="">            <Optgrouplabel= "China">                    <optionvalue= "Hebei">Hebei Province</option>                    <optionvalue= "Henan">Henan Province</option>                    <optionvalue= "Shanxi"selected= "Selected">Shanxi Province</option>                    <optionvalue= "Shandong">Shandong Province</option>            </Optgroup>        </Select>

Name specifies the value of the menu, size specifies that several rows of values can be displayed by default, mutiple: Whether you can check

Optgroup is a group in the menu, the Union label label Specifies the group name

option displays the value of each level of the menu, value specifies the transfer value

The selected tag is used in the option tag to show whether this menu item is the default value displayed for the multilevel menu

The following are examples of Web pages:

Submit Form button
< P ><  type= "Submit"  name= "Submit"></p  >

Also use the input tag to specify a value using name.

The Submit Form button is used at the end of the form to submit the form above.

CSS Cascading Style Sheets

CSS rules consist of two main parts: selectors, one or more declarations

Example:

<style>P{Color:Red;font-size:20px;        }Div{Color:Green;}    </style>

Use as: Tag name with curly braces, add property Value property in curly braces: value

Four ways to introduce CSS styles inline:
<style= "color:red;font-size:20px"> User registration </H1  >

Inline style can be set for a line of content, the advantage is that it can be targeted to display a line of style, the disadvantage is that batch changes cannot be made.

Embedded:

Embedded in the Head page header input style, you can bulk operation of the note

<Head>    <MetaCharSet= "UTF-8">    <title>Title</title>    <style>P{Color:Red;font-size:20px;        }Div{Color:Green;}    </style></Head>

The sample content for this paragraph changes style for label p.

LINK Type:

CSS style content can be written to a file, and then imported into the HTML file for use, the advantage of the link is that a style can be imported into multiple Web files, batch use

<rel= "stylesheet"  href= "Csshtml.css">
Import: (Learn)

Introduce a standalone. css file into an HTML file, import using CSS rules to introduce external CSS files,<style> tags are also written in the

<type= "Text/css">           </  Style> 

The downside of importing is that when a webpage is slow to open, the page content does not display a style, the original style of the page content is displayed directly, and the imported style is the last one to open the page.

Front-end HTML forms and CSS styles

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.