IT Band of Brothers HTML5 syntax of the HTML language tutorial 2

63410e74536142859060a89cff0212a5.jpg

 

HTML color values ​​provided

Most browsers support a set of color names, color value is a keyword or a digital RGB format, with too many in the page. Only there are 16 color names are supported by the W3C HTML 4.0 standard, which is: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, yellow. If you need to use other colors, you need to use hexadecimal color values. Hex color value is a hexadecimal notation defined, this symbol of red, green and blue values ​​of the composition (RGB). The minimum value of each color is 0 (hex: # 000), the maximum is 255 (hex: #FFF). I.e. each primary color saturation for 256 may, therefore the three primary colors can be mixed to 16,777,216 colors. You need to add "#" sign before the RGB value of each application, e.g. bgcolor = "# 00ff00". If you use the English name represent the color value, you can write the name directly, such as bgcolor = "green".

 

HTML Documentation Comments

If you want to add comments in the source code, easy to read, can be "<-!" Begins with "->" end. HTML uses the following comments:

e82152870ed746328c27da44ececdf59.png

Comment statements only appear in the source code, the browser will ignore the code in the interpretation of the content of the comment, but will not appear in the browser. This allows for comments to themselves or others, or temporarily comment out parts of the document not ready. But pay attention not to include comments in the notes, and comments can not be used in tags. In addition, comments can surround and hide the marks. But it notes that, after the comment out marks, to ensure that the rest of the text is still a well-formed HTML document.

prompt

Unless necessary, try not to use too many comments in the HTML code, because some comments need to be downloaded from the server to the local, bandwidth will affect the page loading speed.

 

HTML code format

Any carriage returns or spaces in the source code does not work, so that in the preparation of the HTML code, or may be used Enter code layout space, so that the code can be made clear. We must maintain strict indentation rules to "Tab" key prevail.

 

HTML character entities

Some characters have a special meaning in HTML, for example, less than (<) is used to define the beginning of the HTML tags, not directly in the output page. If we want the browser to correctly display these characters have special meaning, you must insert character entities in the HTML source code.

Character entity has three parts: an ampersand (&); a name of the entity or entities with a # and a number; a semicolon (;). For example, to display the HTML document number is less than, we need to use the "& lt;" or "& # 60;" output physical form. Recommended entity names instead of numbers entities, the benefits that the name is relatively easier to remember. But pay attention to the entity names are case-sensitive. Space is the most common HTML character entities, under normal circumstances, would be cut HTML document spaces. For example, a continuous space 10 in the input document, which then will be removed nine. If you use & nbsp ;, you can increase the space in the document. Some of the more common HTML entities, as shown in Table.

Table common HTML entities

 

e4b507bd1a4340dba2abfaa40ea8e552.png

Guess you like

Origin www.cnblogs.com/itxdl/p/11582290.html