InternetUnicode Draft for Information Only
ContentHTML Coding
HTML CodingHTML document composes of three layers in general..
The consideration in coding for the three layers are also different.. HTML Markup Layer
HTML markup layer is the layer of code used by the rendering engine of a UA for presentation.
In general, only the tagged elements of the plain text layer are processed by the rendering engine, all layout control of the plain text layer outside tagged elements are ignored or removed.
Plain Text Layer Code Input:
HTML Markup Layer Code Input:
HTML Web Page In-line Output: The first paragraph. The second paragraph. Markup CodesThe code of markup layer can be divided into different catalogs.
Markup TagsA tagged element is an element of a HTML document with markup tags. These markup tags are the rendering commands of element tags used by the rendering engine of UA to render the content of a tagged element in a HTML document. Additional or external information in addition to the content of a tagged element is passed to the rendering engine of UA through attributes of element tag. Begin and End MarksA HTML element tag is always a label with a begin mark "<" and an end mark ">". For example, a <p> tag for a paragraph element <p> "<' character is a reserved control character to indicate the beginning of a markup tag in HTML. Any "<" literal character and "<" special character should be replaced by the "<" entity, "<" and the "<" escape character, "%3c" accordingly. Although the ">" character is not a reserved character, any ">" literal character and ">" special character are also replaced by the ">" entity, ">" and the ">" escape character, "%3e" accordingly. Tag Name
Although HTML tags are not case sensitive, lower case HTML tags should always be used in order to be compatible with other stricter document types, for example, XHTML.
HTML Document Input:
HTML Web Page Embedded Output: Opening and Closing Tags
A HTML tagged element is usually marked by an opening tag at the beginnin of the tagged element and a closing tag at the end of the tagged element with the content of the tagged element in between. An opening tag starts with a begin mark "<" and the corresponding tag name is placed immediately next to the begin mark with no white space in between. The first ">" character after the begin mark will be assumed as the end mark ">". A closing tag starts with a begin mark "<", a closing indicator "/" is placed immediately next to the begin mark with no white space in between, and then the corresponding tag name is placed immediately next to the closing mark "/" with no white space in between. The first ">" character after the begin mark will be assumed as the end mark ">". For example, a <p> tag element
HTML Document Input:
HTML Web Page Embedded Output: Although some opeining and closing tags are optional tags in HTML, these optional tags should always be used whenever necesssary in order to be compatible with other stricter document types, for example, XHTML. Examples of optional tags are <BODY>, </BODY>, </P>,... Closing of Tagged ElementsIn HTML, some closing tags are optional. For example, a <p> tag element <P>A <p> tag element with no closing tag. There is also empty tagged element in HTML with no closing tag for the element. For example, a <br> tag element <BR> For empty tagged element with no content, a closing tag is forbidden in HTML, but an opening tag can alway be closed properly by adding a "slash" as the last closing attribute of a tagged element such that the HTML document is readable by XML parsers. For example, a closed <BR> tag element. <br /> Attributes of Element Tags
Attributes of an element tag are seperated by a white space, all continuous spaces between attribute are considered as one single space. For example,
HTML Document Input:
HTML Web Page Embedded Output: Attribute Names
Although lowercase attribute name is recommended in HTML 4.01 and HTML5 standard does not require lowercase attribute name, an attribute name can be written in uppercase or lowercase in HTML.
However a lowercase attribute name should be used in order to be compatible with othe stricter document types, for example, XHTML.
HTML Document Input:
HTML Web Page Embedded Output: HTML Document Input:
Attribute Values
Although a quoted attribute value is recommended in HTML 4.01 and HTML5 standard does not require quoted attribute value, an attribute value can be either quoted or unquoted. However a quoted attribute value should be used in order to be compatible with othe stricter document types, for example, XHTML. Besides, an attribute value sometimes must be quoted on certain case. For example, an attribute value with a white space which is defined as an attribute seperator if the attribute value is not quoted.
HTML Web Page Embedded Output: Double or Single Quoted Attribute ValuesUsing double quotes for quoted attribute values are the most common case in HTML. But, single quotes can also be used for quoted attribute values especially when the attribute value itself contains double quotes. For example a title attribute with double or single quotes
HTML Document Input:
HTML Web Page Embedded Output: However, a double quote quoted attribute value should always be used whenever possible. Attribute ValueIn general, an attribute value is processed according to the specific attribute of a specific element. Script ContentsIn general, an script contents is processed according to the specific attribute of a specific <script> tag element. Preformatted ContentsIn general, a <pre> tag element is used to define preformatted text contents, all charcters including lay-out inputs, for example, white spaces, horizontal tab, and line breaks, of all nested text contents are preserved as typed. Usually a fixed-width, non-proportional, or monospace font is used to render text within the <pre> tag element such that texts are displayed exactly as these characters is laid out in the code of plain text layer.
Like other tagged elements, a <pre> tag only adds a preformatted rendering to the text contents within the tagged element, not element tags. Therefore, other permissible element tags can also be added in between to alter the rendering of the text contexts if necessary.
HTML Document Input:
HTML Web Page Embedded Output: Text ContentsIn general, for text contents not nested in a <pre> or <script> tag element, all control characters, for example, linefeed, horizontal tab, and carriage return, in the plain text document are not used by the HTML markup language in presenting the HTML document, these control characters are replaced by a white space. And then any number of continuous white spaces in HTML tagged elements are counted as one single space only ©sideway ID: 180300007 Last Updated: 3/7/2018 Revision: 0 Latest Updated Links
|
Home 5 Business Management HBR 3 Information Recreation Hobbies 8 Culture Chinese 1097 English 339 Travel 8 Reference 79 Computer Hardware 251 Software Application 213 Digitization 32 Latex 52 Manim 205 KB 1 Numeric 19 Programming Web 289 Unicode 504 HTML 66 CSS 65 SVG 46 ASP.NET 270 OS 431 DeskTop 7 Python 72 Knowledge Mathematics Formulas 8 Set 1 Logic 1 Algebra 84 Number Theory 206 Trigonometry 31 Geometry 34 Calculus 67 Engineering Tables 8 Mechanical Rigid Bodies Statics 92 Dynamics 37 Fluid 5 Control Acoustics 19 Natural Sciences Matter 1 Electric 27 Biology 1 |
Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019