HTML form, (inline) frame, background, color __html

Source: Internet
Author: User
Tags html form
form

A form is a range that contains the elements of a form.

Form elements are elements that allow users to enter information in table consignments such as text fields, Drop-down lists, radio boxes, check boxes, and so on.

Forms use the Form label (<form>) definition.

<form> ...
  INPUT element
...
</form>
input

The form label used in most cases is the input label (<input>). The input type is defined by a type attribute (type). Most of the input types that are often used are the following: text field (Fields)

Text fields are used when users want to type letters, numbers, and so on in the form.

<form> a
: 
<input type= "text" name= "FirstName"/> <br/> Last
name: 
<input type= "text" name= "LastName"/>
</form>

The browser appears as follows: Name:
Last Name:

Note that the form itself is not visible. Also, in most browsers, the default width of a text field is 20 characters. radio button (Radio Buttons)

A radio box is used when a user selects one of several given selections.

<form>
<input type= "Radio" name= "Sex" value= "male"/> "male <br/> <input type=
" Radio "Name=" Sex "value=" female "/> Female
</form>

The browser appears as follows: Male
Female

Note that you can only select one from. check box (checkboxes)

A check box is used when the user needs to select one or more options from several given selections.

<form>
<input type= "checkbox" name= "Bike"/>
I have a bike <br/> <input type=
" CheckBox "Name="/>
I have a car
</form>

The browser appears as follows: I have a bike
I have a car form's Action property (action) and confirmation button

When the user clicks the Confirm button, the contents of the form are routed to another file. The action properties of the form define the file name of the destination file. This file, defined by the action attribute, usually handles the input data that is received.

<form name= "Input" action= "html_form_action.asp" method= "get" >
Username: 
<input type= "text" Name= " User "/>
<input type=" Submit "value=" Submit "/>
</form>

The browser appears as follows: Username:

If you type a few letters in the text box above and then click on the Confirmation button, the input data is sent to the "html_form_action.asp" page. The page will display the results of the input.


Framework

By using frames, you can display more than one page in the same browser window. Each HTML document is referred to as a frame, and each frame is independent of the rest of the framework.

The downside of using frames: Developers must track more HTML documents at the same time it's hard to print an entire page frame structure label (<frameset>) Frame structure label (<frameset>) defines how to split a window into frames per frameset Defines a series of row or column rows/columns values that specify the area of each row or column that occupies the screen

Editor's note: Frameset tags are also translated into frame sets by some articles and books. frame Labels (frames)

The frame label defines the HTML document that is placed in each frame.

In the following example, we set up a two-column frameset. The first column is set to occupy 25% of the browser window. The second column is set to occupy 75% of the browser window. The HTML document "Frame_a.htm" is placed in the first column, and the HTML document "Frame_b.htm" is placed in the second column:

<frameset cols= "25%,75%" >
<frame src= "frame_a.htm" >
<frame src= "frame_b.htm" >
</ Frameset>
Basic considerations-Useful tips:

If a frame has a visible border, the user can drag the border to change its size. To avoid this, you can add: noresize= "Noresize" in the <frame> tag.

Add <noframes> label to browsers that do not support frames.

Important: You cannot use the <body></body> label with <frameset></frameset> tags at the same time. However, if you add a <noframes> tag that contains a piece of text, you must nest the text inside the <body></body> tag. Add the syntax of an IFRAME

<iframe src= "URL" ></iframe>

The URL points to the location of the quarantine page. Iframe-Set height and width

The height and Width properties are used to specify the altitude and width of the IFRAME.

The default units for property values are pixels, but they can also be set in percentages (such as "80%"). instance

<iframe src= "demo_iframe.htm" width= "height=" ></iframe>

Try the Iframe yourself -Remove the border

The Frameborder property stipulates whether the border around the IFrame is displayed.

Set the property value to "0" to remove the border: instance

<iframe src= "demo_iframe.htm" frameborder= "0" ></iframe>

Try it yourself . Use an IFRAME as a link target

An IFRAME can be used as a linked target.

The target attribute of the link must refer to the IFRAME's Name property: instance

<iframe src= "demo_iframe.htm" name= "iframe_a" ></iframe>
<p><a href= "http://" www.w3school.com.cn "target=" Iframe_a ">W3School.com.cn</a></p>

Try the background for yourself (backgrounds)

<body> a label with two configuration backgrounds. The background can be a color or an image. background color (bgcolor)

The background color property sets the background to a color. The property value can be a hexadecimal number, an RGB value, or a color name.

<body bgcolor= "#000000" >
<body bgcolor= "RGB (0,0,0)" >
<body bgcolor= "BLACK" >

The above code sets the background color to black. background (Background)

Background property sets the background to an image. The property value is the URL of the image. If the image size is smaller than the browser window, the image is copied throughout the browser window.

<body background= "Clouds.gif" >
<body background= "Http://www.w3school.com.cn/clouds.gif" >

A URL can be a relative address, such as the first line of code. You can also make an absolute address, such as a second line of code.

Tip: If you plan to use a background image, you need to remember a few things: whether the background images increase the load time of the page. Tip: Image files should not exceed 10k. Whether the background image matches the other images in the page is good. Whether the background image matches the text color in the page. After the image is tiled in the page, does it look OK. Is the attention of the text distracting by the background image? Basic considerations-Useful tips:

The background color (bgcolor), background (background), and text properties in the <body> label have been discarded in the latest HTML standards (HTML4 and XHTML). The consortium has removed these attributes from their recommended standards.

You should use cascading style sheets (CSS) to define the layout and display properties of HTML elements. Color Values

The color is defined by a hexadecimal symbol, which consists of red, green, and blue values (RGB).

The minimum value for each color is 0 (16: #00). The maximum value is 255 (16: #FF).

This table gives a concrete effect of three colors:

Color Color HEX Color RGB
#000000 RGB (0,0,0)
#FF0000 RGB (255,0,0)
#00FF00 RGB (0,255,0)
#0000FF RGB (0,0,255)
#FFFF00 RGB (255,255,0)
#00FFFF RGB (0,255,255)
#FF00FF RGB (255,0,255)
#C0C0C0 RGB (192,192,192)
#FFFFFF RGB (255,255,255)
Color name

Most browsers support a collection of color names.

Hint: only 16 color names are supported by the HTML4.0 standard of the consortium. They are: Aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, yellow.

If you need to use a different color, you need to use a hexadecimal color value.

Color Color HEX Color Name
#F0F8FF AliceBlue
#FAEBD7 Antiquewhite

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.