In HTML, What Is a Background Tag?
The body element is the body that defines the document. The body element contains all the content of the document (such as text, hyperlinks, images, tables, lists, etc.) The body is an HTML tag used in a web page, and the tag is an HTML tag used in a web page to represent the web page. The main part, that is, the content that the user can see, can contain text, pictures, audio, video and other content!
body
(Body is an HTML tag used in web pages)
- The body element is the body that defines the document. The body element contains all the content of the document (such as text, hyperlinks, images, tables, lists, etc.) The body is an HTML tag used in a web page, and the tag is a kind of used in a web page
- The <body> tag represents the body of an HTML page, and the content inside the tag is visible to users.
- Only one <body> tag can exist in an HTML file. [1]
- By default, the document is displayed some distance from the browser's border. In the markup, you can customize the distance between the edge of the document and the window by adding attributes.
- topmargin: the size of the top edge of the document
- Mar leftmargin: the size of the left edge of the document
- (3) rightmargin: the size of the right edge of the document
- bottommargin: the size of the bottom edge of the document
- E.g:
- Here the unit of the edge size is "pixels".
- Alignment properties, range properties:
- ALIGN = LEFT, left justified (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, foreground color, refer to the color comparison table.
- BGCOLOR = # RRGGBB, background color.
- Basic structure label:
- <HTML>; indicates that the file is an HTML file
- <HEAD> ;, including the title of the file, the script used, the style definition, etc.
- <TITLE> --- </ TITLE>; contains the title of the file, and the title appears in the browser title bar
- </ HEAD>, <HEAD>;
- <BODY> ;, place all flags and attributes of the information displayed in the browser, where the content is displayed in the browser.
- </ BODY>, <BODY>; the end sign
- </ HTML>, <HTML>; the end sign
- Other main tags, all the following signs are used in <BODY> </ BODY>;
- <A, HREF = ""> </A>;, link flag, "..." is the file address of the link
- <IMG, SRC = ""> ;, display the picture logo, "..." is the address of the picture
- <BR>;, line break sign
- <P> ;, segmentation flag
- <B> </ B>; in bold type
- <I> </ I>; in italics
- <HR> ;, horizontal line drawing
- <TABLE> </ TABLE> ;, define tables, important flags in HTML
- <TR> </ TR> ;, defines the rows of the table, used in <TABLE> </ TABLE>;
- <TD> </ TD> ;, the cell defining the table, used in <TR> </ TR>;
- <FONT> </ FONT> ;, font style flag
- Attributes:
- Attributes are used to decorate the flag, and attributes are placed inside the start flag.
- Example: The attribute bgcolor = "BLACK" indicates that the background color is black.
- Examples of reference properties:
- <BODY bgcolor = "BLACK"> </ BODY>; the page background color is black;
- <TABLE bgcolor = "BLACK"> </ TABLE>; indicates that the table background color is black.
- Common attributes:
- Alignment properties, range properties:
- ALIGN = LEFT, left justified (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, foreground color, refer to the color comparison table.
- BGCOLOR = # RRGGBB, background color.
- <center>; means absolutely centered.
- <table> </ table>; the beginning and end of the table identifier.
- Attributes:
- cellpadding = The unit of the value is pixels, which defines the table padding
- cellspacing = The unit of value is pixels, which defines the cell spacing
- border = The unit of value is pixels, which defines the width of the table border
- width = value unit is pixel or window percentage, define table width
- background = Image link address, defines the table background image
- <tr> </ tr>; the beginning and end of a table row in the table;
- <td> </ td>; the beginning and end of a cell in a row in a table
- Attributes:
- Colspan = "", the cell spans multiple columns;
- Rowspan = "", the cell spans multiple rows;
- Width = ""; Define table width
- Height = ""; define table height
- Align = ""; alignment
- Valign = "";
- Border = "", border width;
- Bgcolor = "", background color;
- Bordercolor = "", border color;
- Bordercolorlight = "", the color of the bright side of the border;
- Bordercolordark = "", the color of the dim side of the border;
- Cellpadding = "", the distance between the content and the border (the default is 2);
- Cellspacing = "", the distance between cells (default is 2);
- <br>; forced line break
- <font> </ font>; the beginning and end of the text mark
- Attributes:
- face = font
- color = color
- <b> </ b>; start and end of bold text mark
- Attributes:
- style = font-size: 40pt; use the style sheet to control the font size, here is 40 points
- <dl> </ dl> ;, the beginning and end of the partition ID
- Attributes:
- align = | center | left | right | Horizontal alignment
- <marquee> </ marquee>; the start and end of the dynamic logo, if you place a map format in the logo, you can achieve image scrolling
- Attributes:
- scrollamount = 1 ~ 60, scroll speed
- direction = | left | right | up | down |, scroll direction
- scrolldelay = Scroll delay in milliseconds
- <P>; paragraph identifier,
- Space character,
- <img>; sticker identification
- Attributes:
- src = .. / .. / Image link address, required attributes for sticker 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 inner frame "
- <embed, src = "...">; multimedia file identification
- Attributes:
- SRC = "../../ FILENAME",
- Set the path of the music file. In addition to playing .rm; .mp3; .wav audio files, you can also play .swf and .mov videos.
- AUTOSTART = TRUE / FALSE,
- Whether to automatically play music files after transmission, TRUE is required, FALSE is not required, the default is FALSE
- LOOP =, set the repeat number of playback, LOOP = 6 means repeat 6 times, true or -1 means infinite loop, false means stop once after playing.
- STARTIME = "minutes: seconds",
- Set the start time of the song, such as STARTIME = 00: 20 after 20 seconds
- VOLUME = 0-100,
- Set the volume. If not set, use the system volume.
- WIDTH, HEIGHT,
- Set the size of the control panel, all set to 0 to hide the player
- HIDDEN = TRUE,
- Hide control panel
- CONTROLS = CONSOLE / SMALLCONSOLE,
- Set the appearance of the control panel,
- <bgsound, src = ""> ;, background music logo, can only be used in .wav and .mp3 formats.
- Attributes:
- LOOP =, set the repeat number of playback, LOOP = 6 means repeat 6 times, true or -1 means infinite loop, false means stop once after playing.
- Form label:
- <form> </ form>; the beginning and end of the form identification, the contents of the form are placed here.
- The following labels are placed in the form:
- <select>; drop-down selection box
- <option> </ option>
- </ select>
- Attributes:
- Multiple
- <textarea> </ textarea>; edit block for large text input
- Attributes:
- Cols = "", OK;
- Rows = "", columns;
- <input type = "text"> ;, text box
- <input type = "password"> ;, password box
- <input type = "submit"> ;, submit button
- <input type = "checkbox"> ;, checkbox
- <input type = "radio"> ;, radio box
- <input type = "reset"> ;, reset button
- <input type = "image"> ;, image button
- <input type = "hidden"> ;, hidden field
- <input type = "button"> ;, button
- <input type = "file"> ;, browse the file
- Public attributes:
- Name = "";
- Value = ""
- Size = ""
- Frame label:
- <FRAMESET> ... </ FRAMESET> ;, define the frame.
- <FRAME> ;, placed in the frame tag, defines the content of each frame.
- Attributes:
- Cols = ""
- Rows = ""
- Frameborder = ""
- Framespacing = ""
- src = ""
- Scrolling = "", scroll bar (No, Yes);
- Noresize, the box plus size is immutable;
- Marginhight = "", high free space;
- Marginwidth = "", width free space;
- Target = "", the target framework.
- Other tags:
- <bgsound> ;, background music;
- Src = ""
- Loop = "", number of loops;
- <embed> ;, media playback block;
- Src = ""
- Loop = "", number of loops;
- <marquee> </ marquee> ;, scroll part;
- Attributes:
- Bgcolor = ""
- Behavior, set or get how text scrolls in subtitles.
- Direction = "", scrolling direction;
- Height = ""
- Width = ""
- Loop = "", number of loops;
- scrollAmount = "", sets or gets the number of text scroll pixels between each subtitle drawing sequence.
- scrollDelay = "", set or get the speed of the subtitle scrolling.
- scrollHeight = "", Get the scroll height of the object;
- scrollLeft = "", sets or gets the distance between the left border of the object and the leftmost end of the content currently visible in the window.
- scrollTop = "", sets or gets the distance between the top of the object and the top of the visible content in the window.
- trueSpeed = "", Sets or retrieves the position of the subtitles using the scrollDelay and scrollAmount properties. The actual time that has elapsed comes from the clock.
- <! --...--> ;, comment tags, content between "<!-" And "->" will not be displayed in the browser.
- -
- Basic tags:
- <html> </ html> ;, create an HTML document;
- <head> </ head>; set the document title and other information not displayed on the web page;
- <title> </ title> ;, set the title of the document;
- <h1> </ h1> ;, the largest title;
- <pre> </ pre> ;, pre-formatted text;
- <u> </ u> ;, underline
- <b> </ b> ;, bold type;
- <i> </ i> ;, italics;
- <tt> </ tt> ;, typewriter-style fonts;
- <cite> </ cite> ;, quotes, usually italic;
- <em> </ em> ;, emphasize text (usually italic and bold);
- <strong> </ strong>; heavy text (usually italicized and bolded);
- <font, size = "", color = ""> </ font>; set the font size from 1 to 7, and use the name or RGB hex value for the color;
- <BASEFONT> </ BASEFONT> ;, the base font mark;
- <big> </ big>;
- <SMALL> </ SMALL> ;, the font size is reduced;
- <STRIKE> </ STRIKE> ;, strikethrough;
- <CODE> </ CODE> ;, code;
- <KBD> </ KBD> ;, keyboard characters;
- <SAMP> </ SAMP> ;, examples;
- <VAR> </ VAR> ;, variables;
- <BLOCKQUOTE> </ BLOCKQUOTE> ;, indent to the right;
- <DFN> </ DFN> ;, predicate definition;
- <ADDRESS> </ ADDRESS> ;, address tag;
- <sup> </ SUP> ;, superscript;
- <SUB> </ SUB> ;, subscript;
- <xmp> ... </ xmp>; fixed-width font (blank, newline, positioning function in the file are valid)
- <plaintext> ... </ plaintext>; fixed-width font (does not implement markup symbols);
- <listing> ... </ listing> ;, fixed-width small font;
- <font, color = 00ff00> ... </ font>; font color;
- <font, size = 1> ... </ font>; the smallest font;
- <font, style, = 'font-size: 100, px'> ... </ font>; infinite increase.
- Format label:
- <p> </ p> ;, create a paragraph;
- <p, align = ""> ;, align paragraphs to the left, center, and right;
- <br>;, line feed, insert a carriage return and line feed;
- <blockquote> </ blockquote>; indent text from both sides;
- <dl> </ dl> ;, list tags, define lists;
- <dt> ;, define the title of the list;
- <dd> ;, define the content of the list;
- example:
- <dl>
- <dt>; Heading 1 </ dt>
- <dd>; Content 11 </ dd>
- <dd>; Content 12 </ dd>
- <dt>; Heading 2 </ dt>
- <dd>; Content 21 </ dd>
- <dd>; Content 22 </ dd>
- </ dl>
- <ol> </ ol> ;, list tag, defines a list marked with numbers;
- <ul> </ ul> ;, list tag, defines a list marked with dots;
- <li>; placed before each list item;
- Put it in <ol> </ ol>; between each list item plus a number, put it in <ul> </ ul>; between each list item add a dot
- <dl, align = ""> </ dl>; partition tags, used to format large blocks of HTML paragraphs, and also used to format tables;
- <MENU> ;, list of options;
- <DIR> ;, directory listing;
- <nobr> </ nobr> ;, forcing a line break;
- <hr size = '9', width = '80% ', color =' ff0000 '>; horizontal line (set width);
- <center> </ center>; horizontally centered.
- Link tags:
- <a href="URL"> </a>;, create a hypertext link;
- <a href="mailtEMAIL">
- </a>; create a link to send email automatically;
- <a name="name"> </a>; create a bookmark inside the document;
- <a href="#name"> </a>; create a link to a bookmark located inside the document;
- <Base>; URLs of all other link sources in the document that cannot be recognized by the site;
- <Link>; defines the relationship between a link and the source;
- Link label annotations:
- target = "...", determines where the link source is displayed (user-defined names, _blank, _parent, _self, _top);
- rel = "...", the type of link sent;
- rev = "...", save the type of link;
- accesskey = "...", specify the hotkey of the element;
- shape = "...", allows us to define the client's graphics mirror (default, rect, circle, poly) using the defined shape;
- coord = "...", use pixels or length percentage to define the size of the shape;
- tabindex = "...", use the defined tabindex element to set the focus acquisition order between each element (use the tab key to get the element to focus).
- Form label:
- <table> </ table> ;, create a table;
- <tr> </ tr> ;, each row in the table;
- <td> </ td>; each cell in a row of the table;
- <th> </ th>; Set the table header: usually centered in bold;
- <table cellspacing = ""> ;, set the size of the space between table grids;
- <table border = ""> ;, set the width of the border;
- <table cellpadding = ""> ;, set the size of the space between the table grid border and its internal content;
- <table width = ""> ;, set the width of the table. Use absolute pixel value or percentage of total width;
- <table align = ""> ;, set the horizontal alignment of the table grid (left, center, right, justify);
- <tr align = ""> ;, set the horizontal alignment of the table grid (left, center, right, justify);
- <tr valign = ""> ;, set the vertical alignment of the table grid (baseline, bottom, middle, top);
- <td colspan = ""> ;, set the number of columns spanned by a table grid (the default value is 1);
- <td rowspan = ""> ;, set the number of rows spanned by a table grid (the default value is 1);
- <td nowrap>; prohibit the line break in the table grid;
- <CAPTION> </ CAPTION> ;, the title of the table;
- <COLGROUP> </ COLGROUP>; define multiple columns as a set of columns;
- <TABLE> </ TABLE> ;, create a table;
- <THEAD> </ THEAD>; define the header of the table;
- <COL> ;, define the columns in a column group, so that they can set the relevant attributes at the same time;
- <TBODY> </ TBODY> ;, define a table entity;
- <TFOOT> </ TFOOT>; define the footer of a table;
- Form label:
- <form> </ form> ;, create a form;
- action = "...", the URL of the server receiving the data;
- method = "...", HTTP method (get ,, post), where get is deprecated;
- enctype = "...", specify MIME (Internet Media Type);
- onsubmit = "...", an internal event that occurs when the form is submitted;
- noreset = "...", an internal event that occurs when the form is reset;
- target = "...", decide where to display the content (_blank, _parent, _self, _top)
- <select multiple name = "name" size = ""> </ select>; Create a scroll menu, and set the size to the number of form items that you can see before you need to scroll;
- <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 box area with the number of columns set the width and the number of rows set the height;
- <input type = "checkbox", name = "name">; create a checkbox with the text behind the label;
- <input type = "radio", name = "name", value = "">; create a radio box with the text behind the logo;
- <input type = text, name = "foo", size = 20> ;, create a single-line text input area, 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 using an image;
- <input type = "reset"> ;, create a reset button;
- <BUTTON> </ BUTTON> ;, create a button;
- disabled = "...", set the state of the button to disabled;
- name = "...", the control name of the button, value = "...", the value of the button;
- type = "...", the type of button (button ,, submit ,, reset);
- <FIELDSET> </ FIELDSET>, group related controls together;
- <ISINDEX>; prompt the user for input;
- <LABEL> </ LABEL>; provide a label for a control;
- <LEGEND> </ LEGEND>; specify a title for the FIELDSET element;
- <SELECT> </ SELECT>; make choices for users to create various options;
- <TEXTAREA> </ TEXTAREA>; create an area that allows the user to enter multiple lines.
- Form label annotations:
- type = "...", the type of input control (text, password, checkbox, radio, submit, reset, file, hidden, image, button);
- name = "...", the control name of the control (requires any name except submit and reset);
- value = "...", the initial value of the control;
- checked = "...", set a radio button to the checked state;
- disabled = "...", sets the state of the control to unusable;
- readonly = "...", only used for the text box for entering the password;
- size = "...", which represents the width of other 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 = "...", URL to client graphics image;
- align = "...", is deprecated. Control the alignment (left ,, center ,, right ,, justify);
- tabindex = "...", the order of getting focus between different elements is determined by the defined tabindex value;
- onfocus = "...", the event that occurs when the element gets focus;
- onblur = "...", an event that occurs when an element loses focus;
- onselect = "...", the event that occurs when the element is selected;
- onchang = "...", an event that occurs when the state of an element is changed;
- accept = "...", allow file types to be uploaded.
- Frame label (frame label):
- <frameset> </ frameset>; placed in the <body> of a frame document; it can also be embedded in other frame documents before the tag;
- <frameset rows = "value, value"> ;, define the number of rows in a frame, available pixel value or height percentage;
- <frameset cols = "value, value"> ;, define 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>; define what prompts are displayed in browsers that do not support frames;
- <frame src = "URL"> ;, specify the HTML document displayed in the frame;
- <frame name = "name">; name the frame or area so that other frames can point to it;
- <frame marginwidth = ""> ;, define the margin size of the left and right edges of the frame, must be greater than or equal to 1;
- <frame marginheight = ""> ;, define the margin size of the upper and lower edges of the frame, must be greater than or equal to 1;
- <frame scrolling = ""> ;, set whether the frame has a scroll bar, the value can be "yes", "no", or "auto";
- <frame noresize>; forbid users to adjust the size of a frame;
- <IFRAME> </ IFRAME> ;, create an inline frame;
- scr = "...", defines the source of the content displayed in the frame;
- frameborder = "...", defines the border between frames (0 or 1);
- align = "...", is deprecated, controls the alignment (left ,, center ,, right ,, justify);
- height = "...", the height of the frame, width = "..." the width of the frame;
- <marquee> ... </ marquee> ;, ordinary scrolling;
- <marquee behavior = slide> ... </ marquee> ;, sliding;
- <marquee behavior = scroll> ... </ marquee> ;, preset scrolling;
- <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 right;
- <marquee direction = 'left'> </ marquee>; scroll left;
- <marquee loop = 2> ... </ marquee> ;, scrolling times;
- <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 scroll distance;
- <marquee scrolldelay = 300> ... </ marquee>; set the scroll time;
- <img src = ""> ;, insert the picture, the parameters are: width = "width", alt = "explanatory text", height = "high", boder = "border".
- Document overall attribute tags:
- <body bgcolor = ""> ;, set the background color. Use the name or RGB hex value;
- <body background = ""> ;, set the background image;
- <body bgsound = ""> ;, set the background music;
- <body bgproperties = "fixed"> ;, fixed background image (for IE);
- <body text = ""> ;, set text color. Use name or RGB hex value;
- <body link = ""> ;, set link color. Use name, word or RGB hex value;
- <body vlink = ""> ;, set the color of the used link. Use the name or RGB hex value;
- <body alink = ""> ;, set the color of the link being hit. Use the name or RGB hex value;
- <body topmargin = ""> ;, set the top margin of the page;
- <body leftmargin = ""> ;, set the left margin of the page.
- Optional attributes
- DTD indicates in which DTD this attribute is allowed to be used. S = Strict, T = Transitional, F = Frameset.