HTML Beginner's Guide (10)

Source: Internet
Author: User
Tags format closing tag comments html tags include reference version
Beginner's troubleshooting
Avoid markup overlap
Take a look at this HTML example:

<b>this is a example <DFN>overlapping</B> HTML tags.</dfn>

Overlapping this word is included in both <B> and <DFN> two tags. Browsers are overwhelmed in this situation, so you may not get the results you expect.

In general, you should avoid markup overlap. Check your tags and let them appear in pairs. tags used in pairs (obviously, except for elements that can be omitted from the closing tag, such as paragraph marks) should not be interrupted. Take a look at the above example. Before the middle mark (DFN) is not finished, you cannot make bold mark <B> end. Before you put the file in the server, you should check to see if the following errors are similar.

Embed only anchor chains and character tags mbed only anchors and Character tags
The HTML protocol allows you to embed an excess chain in other HTML tags:


Do not embed HTML tags in a chain anchor:

<a href= "destination.html" >
</A>

Although the current majority of browsers can handle the second example, the formal description of HTML does not support this structure, your file may be in the future browser will be a problem. Remember, a browser that displays incorrectly encoded files can be forgiven. But this tolerance may not be extended to the next version of the software! When there is a doubt, write according to the rules of the HTML specification (see the other information below).

Character markers can be used to change the text display mode in other elements:

<UL>
<li><b>a Bold List Item</b>
<li><i>an Italic list item</i>
</UL>

Avoid embedding other types of HTML element tags. For example, you might want to embed a title font in a list to increase the display of some characters:

<UL>
<li><li></UL>

Although some browsers can display this code well, it is hard to say whether the format will work in the future because it is undefined. To ensure compatibility with all browsers, you should avoid using this structure. (Netscape supports a <FONT> tag that specifies the size of a character to be displayed in the browser, and is not defined in the current official HTML description.)

What is the difference between inserting a <B> tag in a <LI> tag and inserting a <H1> tag in a <LI> tag? The meaning of <H1> in the 訦 tml semantic description is the beginning of the main title font in a document, which should follow the contents of the current document. Therefore, there is no meaning when <H1> occurs in a list.

Character formatting marks are also not usually attached. For example, you might want to write this:

<b><i>some text</i></b>

Expect to get a bold italic text. Some browsers can indeed; Other browsers only explain the inner-most markup.

The final step
Make your coding work.
When you put a document into a WEB server, make sure that the format and each link is correct (including named Anchor chain). Ideally, you should let the other person browse through and comment when you think a document is finished.

You can use HTML validation services to verify that your files are compliant with the currently universally accepted HTML standard. This service is a useful teaching tool if you do not know if your document conforms to the HTML specification. This service allows you to select a level of parity (e.g., strict checksum strict, level two parity 2, level three parity 3). This freedom is useful if you want to use some non-standard formats.

Alternate image
Your browser uses an alternate image when the tag points to an image that does not exist. If this happens when you finally check your file, make sure that the image file you are pointing to does exist, that the hyperlink uses the correct URL information, and that the file attributes are set correctly (readable to everyone). And then check it again!

Update your files
If the contents of a file are static (for example, George Washington's personal biography), it may not need to be updated. But for things that are closely related to time, or that contain areas that are constantly changing, remember to keep updating your files!

Updates are important when a file contains information such as a weekly schedule or a deadline for events. Delete obsolete files or indicate why some outdated information is still on the server (for example, an event requires the same as the current content in the next round, so the file still has a reference value after a period of time).

The difference between browsers
Different Web browsers display HTML elements differently. Remember that not all browsers are capable of interpreting all markup elements in an HTML file. However, browsers often simply ignore tags that are not recognized.

You may have spent a lot of time with your files "looking very pretty" in your current browser. If you look at your file in another browser, it probably looks different or even very different. So keep this in mind: Use the right HTML to write your files. Leave the explanations to the browser and try to get the best results.

Comment on your file
You may need to leave some comments in your HTML file. Comments in HTML are similar to comments in a computer program-the text you enter is not intended to be displayed to the browser, nor can the reader directly see them, as the annotations in the computer program are not used by the program itself, and are not seen by the program's users. However, if the reader looks at the original file, the comment will be visible.

General comments include updating the author name of the file, creating a file using the software and its version, or some minor change information.

The format for adding a note is:

<!--annotation content-->

You must include the exclamation mark and hyphen.

Other information
This guide is just an introduction to HTML, not an exhaustive reference. Here are some other reference information. Don't forget to check out the Web and HTML books in the nearby bookstore first.

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.