Common HTML tags and attributes

Source: Internet
Author: User
Tags comparison table

Basic Structure labels:
<HTML> indicates that the file is an HTML file.
<Head>, including the file title, script used, style definition, etc.
<Title> --- </title>: contains the file title. The title appears in the browser title bar.
</Head>, <Body>. Place all the logos and attributes of the information displayed in the browser. The content is displayed in the browser.
</Body>, <body> end sign
</Html>, <HTML> end mark

Other major tags, which are used in <body> </body>:
<A, href = "... "> </A>, link icon ,"... "Is the link file address
, Show the image logo ,"... "Is the image address
<Br>, line feed flag
<P>, segment marker
<B> </B>, in bold
<I> </I>, in italics
<HR> horizontal line drawing
<Table> </table>: defines a table and an important identifier in HTML.
<Tr> </tr>: defines the rows of a table. It is used in <Table> </table>.
<TD> </TD>: defines the table cells, used in <tr> </tr>
<Font> </font>, font style icon

Attribute:
The attribute is used to modify the flag. The attribute is placed in the Start flag.
For example, the property bgcolor = "black" indicates that the background color is black.
Example of referencing a property:
<Body, bgcolor = "black"> </body> indicates that the background color of the page is black;
<Table, bgcolor = "black"> </table> indicates that the background color of the table is black.

Common attributes:
Alignment attribute, range attribute:
Align = left, left alignment (default), width = pixel value or percentage, object width.
Align = Center, Center, Height = pixel value or percentage, object height.
Align = right, right aligned.
Color attributes:
Color = # rrggbb. For the foreground color, see the color comparison table.
Bgcolor = # rrggbb, background color.

<Center> indicates absolute center.

<Table> </table> start and end of the table identity.
Attribute:
Cellpadding = the unit of value is pixel, which defines the inner distance of the table element.
Cellspacing = the unit of value is pixel, which defines the table meta-spacing.
Border = the unit of value is pixel, which defines the Border width of the table.
Width = the unit of value is pixel or window percentage, which defines the table width.
Background = image link address, which defines the background image of the table
<Tr> </tr> start and end of a table row in a table;
<TD> </TD> start and end of a cell in the row of a table
Attribute:
Colspan = "", the cell spans multiple columns;
Rowspan = "", the cell spans multiple rows;
Width = ""; Define the table width
Height = ""; Define the table height
Align = ""; align
Valign = "";
Border = "", Border width;
Bgcolor = "", background color;
Bordercolor = "", border color;
Bordercolorlight = "", the highlighted border color;
Bordercolordark = "", the dimmed border color;
Cellpadding = "", the distance between the content and the border (2 by default );
Cellspacing = "", the distance between cells (2 by default );

<Br> force line feed
<Font> </font> start and end of the text mark
Attribute:
Face = font
Color = color
<B> </B> start and end of the bold text mark
Attribute:
Style = font-size: 40pt;. Use a style sheet to control the font size. The value is 40 o'clock.
<Div> </div>: start and end of the partition ID
Attribute:
Align = | center | left | right | Horizontal Alignment
<Marquee> </marquee> start and end of a dynamic logo. Image scrolling can be achieved if the texture format is placed inside the logo.
Attribute:
Scrollamount = 1 ~ 60. Scroll speed
Direction = | left | right | up | down |, scroll direction
Scrolldelay = rolling latency, in milliseconds
<P> paragraph identifier,
Space character,
Texture ID
Attribute:
Src =.../image link address, essential attributes of texture Identification
Style = filter: alpha (opacity = 100, style = 2 );
Filter: style sheet filter;
ALPHA: transparent filter,
Opacity: opacity 100 (0 ~ 100 );
Style: Style 2 (0 ~ 3 ),
Rules = "NONE" do not show inboxes"
<Embed, src = "... "> Multimedia file ID
Attribute:
Src = "../FILENAME ",
Set the music file. The file contains a video, such as .rm?.mp3=.wave.com, and .swf and. mov.
Autostart = true/false,
Whether to enable automatic playback after the music file is transferred. True means yes, false means no. The default value is false.
Loop =, set the playback repeat times. Loop = 6 indicates 6 repeat times. "True" or "-1" indicates an infinite loop. "false" indicates that playback is stopped once.
Startime = "minute: Second ",
Set the start time of the music, for example, to startime = after 20 seconds.
Volume = 0-100,
Set the volume. If not set, use the system volume.
Width, height,
Set the control panel size to 0 to hide the player.
Hidden = true,
Hide Control Panel
Controls = console/smallconsole,
Set the display of the control panel,
<Bgsound, src = "... "> Background music identification, which can only be used in. Wavelet and TTS formats.
Attribute:
Loop =, set the playback repeat times. Loop = 6 indicates 6 repeat times. "True" or "-1" indicates an infinite loop. "false" indicates that playback is stopped once.

Form Tag:
<Form> </form> the start and end of the table identity. The content of the form is placed here.
The following labels are placed in the form:
<SELECT> drop-down box
<Option> </option>
</SELECT>
Attribute:
Multiple
<Textarea> </textarea>: editing blocks with large amounts of text input
Attribute:
Cols = "", row;
Rows = "", column;
<Input, type = "text">, text box
<Input, type = "password">, password box
<Input, type = "Submit">, submit the button
<Input, type = "checkbox">, check box
<Input, type = "radio">, single worker
<Input, type = "reset">, reset the button
<Input, type = "image">, image button
<Input, type = "hidden">, hide the field
<Input, type = "button">, click it
<Input, type = "file">, browse files
Public attributes:
Name = "";
Value = ""
Size = ""

Framework Tag:
<Frameset>... </frameset>: defines the framework.
<Frame>, which is placed in the frame label and defines the content of each frame.
Attribute:
Cols = ""
Rows = ""
Frameborder = ""
Framespacing = ""
Src = ""
Scrolling = "", scroll bar (no, yes );
Noresize. The increase in the box is not changeable;
Marginhight = "", highly available space;
Marginwidth = "", available space in width;
Target = "", target framework.

Other labels:
<Bgsound>, background music;
Src = ""
Loop = "", number of cycles;
<Embed>, media play block;
Src = ""
Loop = "", number of cycles;
<Marquee> </marquee>, rolling part;
Attribute:
Bgcolor = ""
Behavior: sets or obtains how text is scrolled in subtitles.
Direction = "", rolling direction;
Height = ""
Width = ""
Loop = "", number of rings;
Scrollamount = "", which sets or obtains the number of text scroll shards between the draw sequence of each subtitle.
Scrolldelay = "", set or get the speed of subtitle scrolling.
Scrollheight = "", get the scroll height of the object;
Scrollleft = "", set or obtain the distance between the left edge of the object and the leftmost end of the currently visible content in the window.
Scrolltop = "", set or obtain the distance between the top of the object and the top of the visible content in the window.
Truespeed = "": determines whether to use the scrolldelay and scrollamount attributes to set or obtain the subtitle position. The actual time passed is calculated based on the clock timing.

<! --... -->, Annotation mark, in "<! The content between -- "and" --> "is not displayed in the browser.

--

Basic tags:
<HTML> <Head> <Title> </title>: Set the document title;
<H1> <PRE> </PRE>: pre-formatted text;
<U> </u>, underline
<B> </B>, in bold;
<I> </I>, italics;
<Tt> </tt>: typewriter-style font;
<Cite> </CITE>, referenced in italic;
<Em> </em>, emphasizing the text (usually italic and simhei );
<Strong> </strong>, to increase the text (usually italic and simhei );
<Font, size = "", color = ""> </font>: Set the font size from 1 to 7. Use the name or the hexadecimal value of RGB;
<Basefont> </basefont>, indicating the base font;
<Big> </big>: Increase the font size;
<Small> </small>, reducing the font size;
<Strike> </strike>: adds a strikethrough line;
<Code> </code>, code;
<KBD> </KBD>, keyboard character;
<SAMP> </SAMP>, example;
<Var> </var>, variable;
<BLOCKQUOTE> </BLOCKQUOTE>, scale down to the right;
<Dfn> </dfn>, description definition;
<Address> </address>, address mark;
<Sup> </sup>, with the upper mark;
<Sub> </sub>: subscripts;
<XMP>... </XMP> fixed-width font (in the file blank, line feed, positioning function is effective)
<Plaintext>... </plaintext> fixed-width font (without marking );
<Listing>... </listing>, small font with fixed width;
<Font, color = 00ff00>... </font> font color;
<Font, size = 1>... </font> minimum font;
<Font, style, = 'font-size: 100, px'>... </font> unlimited increase.

Format tags:

<P> </P>: Creates a paragraph;
<P, align = ""> align the section to the left, center, and right;
<Br>, line feed, insert a carriage return line break;
<BLOCKQUOTE> </BLOCKQUOTE>, indent text from both sides;

<DL> </dl>, list tag, and definition list;
<DT>, define the list title;
<DD>, define the list content;
Example:
<DL>
<DT> Title 1 </DT>
<DD> content 11 </DD>
<DD> content 12 </DD>
<DT> Title 2 </DT>
<DD> content 21 </DD>
<DD> content 22 </DD>
</Dl>

<Ol> </OL>: list tag, which defines a list marked with numbers;

<Ul> </ul>: list tag, which defines a list marked with dots;
<Li>, placed before each list item;
Between <ol> </OL>, a number is added to each list item and a dot is added to each list item between <ul> </ul>;

<Div, align = ""> </div>, partition tag, used to typeset large HTML sections and format tables;
<Menu>, Option List;
<Dir>, directory list;
<Nobr> </nobr>, force line breaks;
<HR, size = '9', width = '000000', color = 'ff000000'> horizontal line (Set width );
<Center> </center>, horizontally centered.

Link Tag:
<A, href = "url"> </a>: Creates a hypertext link;
<A, href = "mailtemail">
</A> create a link to automatically send emails;
<A, name = "name"> </a>: Creates a bookmark in the document;
<A, href = "# name"> </a> to create a link pointing to the internal bookmarks of the document;
<Base>. URLs of all other link sources that cannot be identified by the site in this document;
<Link> defines the relationship between a link and the source;

Link tag annotation:
Target = "...", determines where the link source is displayed (User-Defined name, _ blank, _ parent, _ Self, _ top );
Rel = "...", type of the sent link;
REV = "...", saving the link type;
Accesskey = "...", specifies the key of the element;
Shape = "...", allows us to use a defined shape to define the client's image (default, rect, circle, poly );
Coord = "...", use pixels or length percentages to define the shape size;
Tabindex = "...", use the defined tabindex element to set the focus Acquisition sequence between each element (use the tab key to make the element focus ).

Table tags:
<Table> </table>: Create a table;
<Tr> </tr>: each row in the table;
<TD> </TD>, each grid in the row of the table;
<TH> </Th>, set the table header: Usually the text in the center of the black body;
<Table, cellspacing = "">, set the space size between table cells;
<Table, border = "">, set the Border width;
<Table, cellpadding = "">, set the size of the space between the grid border and its internal content;
<Table, width = "">, set the table width. Use the absolute pixel value or percentage of the total width;
<Table, align = "">, set the horizontal alignment of the table lattice (left, center, right, justify );
<TR, align = "">, set the horizontal alignment of the table lattice (left, center, right, justify );
<TR, valign = "">, set the vertical alignment of the table lattice (baseline, bottom, middle, top );
<TD, colspan = "">, set the number of columns across a table grid (the default value is 1 );
<TD, rowspan = "">, set the number of rows across a table grid (default value: 1 );
<TD, nowrap>: Disable Automatic row disconnection for content in the table grid;
<Caption> </caption>, table title;
<Colgroup> </colgroup>: defines multiple columns as a group;
<Table> </table>: Create a table;
<Thead> </thead>: defines the table header;
<Col>, defines the columns in a column group so that they can be set with relevant attributes at the same time;
<Tbody> </tbody>: defines the object of a table;
<Tfoot> </tfoot>: defines the footer of a table;

Form Tag:
<Form> </form>: create a form;
Action = "...", the URL of the server that receives data;
Method = "...", HTTP method (get, post), where get is opposed to use;
Enctype = "...", specify mime (Internet media type );
Onsubmit = "...", an internal event that occurs when a form is submitted;
Noreset = "...", an internal event that occurs when the form is reset;
Target = "...", determines where the content is displayed (_ blank, _ parent, _ Self, _ top)
<Select, multiple, name = "name", size = ""> </SELECT>: Create a scroll menu and set the size to the number of table items that can be viewed before scrolling;
<Option>, set the content of each form item;
<Select, name = "name"> </SELECT>: Create a drop-down menu;
<Textarea, name = "name", cols = 40, rows = 8> </textarea>: Create a text area, set the number of columns to width, and set the number of rows to height;
<Input, type = "checkbox", name = "name">. Create a check box with the text following the label;
<Input, type = "radio", name = "name", value = "> create a single sequence, followed by the text mark;
<Input, type = text, name = "foo", size = 20>. Create a single line text input area. The size is set to the width of the string;
<Input, type = "Submit", value = "name">. Create a submit button;
<Input, type = "image", border = 0, name = "name", src = "name.gif"> Create a submit button for using images;
<Input, type = "reset">, create a reset button;
<Button> </button> to create a button;
Disabled = "...", set the button status to not;
Name = "...", the control name of the button, value = "...", the value of the button;
Type = "...", button type (button, submit, reset );
<Fieldset> </fieldset>: combines the associated controls into a group;
<Isindex>, prompting the user to enter;
<Label> </label> to provide a label for a control;
<Legend> </legend>: Specifies a title for the fieldset element;
<SELECT> </SELECT> to create various options for users;
<Textarea> </textarea> to create an area that allows users to input multiple rows.

Form tag annotation:
Type = "...", used to input the control type (text, password, checkbox, radio, submit, reset, file, hidden, image, button );
Name = "...", control name (requires any name except submit and reset );
Value = "...", the initial value of the control;
Checked = "...", set a single button to the selected status;
Disabled = "...", set the control status to unavailable;
Readonly = "...", only used in the text box that enters the password;
Size = "...", indicating the width of all controls except the text box and Password box controls in pixels. It is used to specify the number of characters;
Src = "...", the URL of an image control;
Maxlength = "...": specifies the maximum number of characters that can be entered;
Alt = "...", another text description;
Usemap = "...", to the client image URL;
Align = "...", opposed to. Controlling alignment (left, center, right, justify );
Tabindex = "...", the sequence in which the focus is obtained between different elements is determined by the defined tabindex value;
Onfocus = "...", an event that occurs when the element gets the focus;
Onblur = "...", an event that occurs when the element loses focus;
Onselect = "...", an event that occurs when an element is selected;
Onchang = "...", an event that occurs when the element state is changed;
Accept = "...", the type of file to be uploaded.

Frame tag (frame tag ):
<Frameset> </frameset>, which is placed before the <body> label of a frame document. It can also be embedded in other frame documents;
<Frameset, rows = "value, value">, defines the number of rows in a frame, available pixel value or height percentage;
<Frameset, cols = "value, value">, defines the number of columns in a frame, available pixel value or width percentage;
<Frame> defines a single window or window area within a frame;
<Noframes> </noframes> defines what prompts are displayed in browsers that do not support frames;
<Frame, src = "url"> specifies the HTML document displayed within the frame;
<Frame, name = "name">, name a frame or region so that another frame can point to it;
<Frame, marginwidth = "">, defines the blank size of the left and right sides of the frame, which must be greater than or equal to 1;
<Frame, marginheight = "">, defines the blank size of the upper and lower edges of a frame, which must be greater than or equal to 1;
<Frame, scrolling = "">, sets whether a frame has a scroll bar. The value can be "yes", "no", or "Auto ";
<Frame, noresize>. You are not allowed to adjust the size of a frame;
<IFRAME> </iframe> to create an inline frame;
Scr = "...", defines the source of the content displayed in the frame;
Frameborder = "...", defines the boundary between frames (0 or 1 );
Align = "...", opposed, control alignment (left, center, right, justify );
Height = "...", frame height, width = "..." frame width;
<Marquee>... </marquee>, General rolling;
<Marquee, behavior = slide>... </marquee>, slide;
<Marquee, behavior = scroll>... </marquee>, default rolling;
<Marquee, behavior = alternate>... </marquee>, scroll back and forth;
<Marquee, direction = down>... </marquee>, scroll down;
<Marquee, direction = up>... </marquee>, scroll up;
<Marquee, direction = right> </marquee>, scroll to the right;
<Marquee, direction = 'left'> </marquee>: Scroll left;
<Marquee, loop = 2>... </marquee>;
<Marquee, width = 180>... </marquee>, set the width;
<Marquee, Height = 30>... </marquee>, set the height;
<Marquee, bgcolor = ff0000>... </marquee>, set the background color;
<Marquee, scrollamount = 30>... </marquee>, set the rolling distance;
<Marquee, scrolldelay = 300>... </marquee>: Set the rolling time;
, insert an image with the following parameters: width = "width", ALT = "description text", Height = "height", boder = "border ".

Overall Document Property Tag:
<Body, bgcolor = "">, set the background color. Use the name or the hexadecimal value of RGB;
<Body, background = "">, set the background image;
<Body, bgsound = "">, set the background music;
<Body, bgproperties = "fixed">, fixed background image (applicable to IE );
<Body, text = "">, set the text color. Use the name or the hexadecimal value of RGB;
<Body, link = "">, set the link color. Use the name, word, or hexadecimal value of RGB;
<Body, vlink = "">, set the color of the used link. Use the name or the hexadecimal value of RGB;
<Body, alink = "">, set the color of the link being hit. Use the name or the hexadecimal value of RGB;
<Body, topmargin = "">, set the top margin of the page;
<Body, leftmargin = "">, set the left margin of the page.

 

reprinted statement: This article is transferred from the http://pettynic.blog.163.com/blog/static/588320552009390144277/

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.