Web standard knowledge-enrich the labels in paragraphs

Source: Internet
Author: User
Tags code tag

If you have started to follow the WEB standards, how can it be? The WEB standards are gradually applied in your work, so this article will give you a better understanding of the details in the Section. If you are just ready to start, you can first look at "starting from p, step by step", and then read this article.
Last night, I decided to stop inserting CSS content at this time and continue to penetrate into the XHTML content. Maybe you will think that XHTML is far from CSS fun. Yes, indeed, CSS can change with countless visible possibilities. XHTML is only for machines and programs. But in fact, XHTML is much more important than CSS. We all know that web pages are used to carry information, data, and knowledge. These are called "content" for the time being ". The first element of a website is content. A webpage without content may not be called a webpage, however, if you put a pile of content together without tags to distinguish paragraphs, highlights, references, and so on, the content will be crowded together and cannot be read. Even if you are a CSS master, in a bunch of documents without XHTML tags, you can't start to beautify it. Yes, the content requires XHTML to distinguish the content and make it useful for CSS. If the content is the guts and soul, CSS is the flesh, and XHTML is the skeleton.

Of course we can't waste time on the importance of XHTML. Now we will introduce the labels that can be used in paragraphs one by one. (Pay attention to this sentence: "labels used in paragraphs", which indicates that these labels are not block-level labels. Is an inline label .) The first thing to introduce is to emphasize the labels-strong and em. Why do we introduce two tags at a time? Because both labels are highlighted. Why is it so wasteful to use two tags? Although they all mean something, the intensity of the emphasis is different. Strong is more powerful than em. If em is the "Emphasis" and "Attention" in Chinese words, strong is the "Emphasis" and "special attention ". Of course, the emphasis on tags cannot be abused in the text, and reasonable use will highlight the key content in the article. In general, you can use em. If you need to use strong with special emphasis.

Some may say that the difference between strong and em is that the content in strong is in bold and the content in em is in italic. This statement is incorrect because the two labels do not have style attributes. HTML tags include some style labels such as <B> <I> <u>, and style labels are not recommended in XHTML. The strong content we see in the browser is displayed in bold, which is just the preset style of the browser label. It does not mean striong is in bold. If one day the browser no longer provides preset styles, the contents in strong will not show any styles. The same is true for em. If you are interested in this issue, please refer to the article "meaning and style are irrelevant.

We all like to use acronyms to express specific things or events. The advantage of doing so is to facilitate express delivery of information, instead of making so long texts every time, especially for repeated words. What XHTML labels should the acronyms use? This time, we will introduce two tags: abbr and acronym. The two labels have the same general purpose, but they are still different in details. For example, <abbr> </abbr> indicates that the content in the tag is abbreviated. <Acronym> </acronym> indicates that the content in the tag is an acronym. You have noticed that I have used em to emphasize "acronyms. Generally, acronym is more commonly used than abbr in English, but the opposite is true in Chinese. Because there is no abbreviation in Chinese. There may be acronyms, but there are few. For example, the People's Republic of China, China for short, and the National People's Congress for short, people's congress for short. These are not abbreviations. Here I think abbr should be used when Chinese idioms appear in the text. Of course, this label alone is not enough, because only knowing that he is a acronyms is not enough, at least a detailed name should be provided. Therefore, when using these two tags, you need to add a title attribute. The correct method should be like this. <Acronym title = "European Computer Manufacturers Association"> ECMA </acronym>; <abbr title = "step by step. "> Step by step </abbr> the content in the title is not directly displayed in the browser. The floating prompt is displayed only when the mouse moves to that position. Of course, the abbreviation label is used only when the acronyms appear for the first time. It will be no longer used in the article.

Does your document contain acronyms? Have you provided complete acronyms? If you have a quick application, this will make your documents more popular. If you want your documents to be popular, your documents must be polite. Some may say: you are crazy. How are documents polite? In fact, documents do need to be polite. For example, if you reference a reference, book, or magazine from someone else, do you mark it? This is the courtesy of the document we will talk about here. Respect others. For example, if I want to recommend an article about others to everyone, I need to handle it like this: <a href = "...... "> <Cite> the title of the recommended Article <cite> </a> you have noticed that there is A cite tag in the tag. Of course, if you need to reference a sentence or a piece of text, this label is not suitable. This label only lists the titles and names of documents. This label is a bit similar to the contents of the reference document behind our book, and also a bit like a footer. Of course, the cite label can be processed in this way. We will introduce the labels that need to reference a sentence or text in segments later.

For our industry, the probability of code appearing in documents is too high. Then, how to separate the code and content in the document requires specific labels. The most common and simple code tag is introduced here. This label only serves to process some short code. It is not suitable for a large number of code that requires branch and indentation, the code label is suitable for some codes that appear in this article. If you are interested, open the source code of this article. For more information about how to deal with a large amount of code, please read more.

I would like to remind you that reading this article does not play any role. It is most important to apply what you see to your work. As long as you are in the application, you will be far from successful. Let's work together and cheer up

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.