In XHTML tags, some tags have similar functions. Of course, similarity here refers to semantic similarity, so many people don’t know how to use these similar tags. So today’s topic is to decompose similar tags and clarify the uses of each tag. We have already talked about the difference between strong and em. In addition to strong and em, there are some similar tags such as q and cite
In XHTML tags, some tags have similar functions. Of course, similarity here refers to semantic similarity, so many people don’t know how to use these similar tags. So today’s topic is to decompose similar tags and clarify the uses of each tag. We have already talked about the difference between strong and em. In addition to strong and em, there are some similar tags such as q, cite, and blockquote. These three belong to the category of reference, but there are still some differences here, let’s explain them one by one.
<q></q>, the function of q is to quote non-block elements, that is, to quote content that cannot form a paragraph. It may be a sentence that someone said, or an excerpt of a document, etc. The characteristics are obvious. Here is a sentence. And q itself does not produce paragraphs. q itself has no style, and generally browsers will not set a default style for it to highlight. But we can distinguish it from general content through CSS. There is another attribute in the q tag that is very important, that is cite. In this cite attribute value, it mainly indicates where the referenced content comes from, or gives the online address.
<q cite=http://andymao.com/andy/post/92.html>This content will give you a better understanding of the details in the paragraph</q>
Be especially careful not to write q as p. These two labels are easy to make mistakes.
In the previous article, I actually talked about cite. In that article, I wrote that this tag only displays the title and name of the document. This label is a bit similar to the content of the references at the back of our book, and is also a bit like a footnote.
So what is the difference between him and q? In fact, it is easy to understand. q is the display of content, while cite is the display of the name of the person or the title of the book that says this content. Cite and q are often used in a mixture. for example:
Mr. Lu Xun said: There was no road on the ground, but when there were too many people walking, there was a road. Watch more html tagged content on this site.
So what is the difference between blockquote and them? blockquote is a block reference, which XHTML allows it to contain any tags. The above q and cite are not so much tolerance. The use of blockquote is used when a paragraph or multiple paragraphs is required. The browser generally defaults to indent the referenced content to distinguish it from normal paragraph articles. Of course we can change the form of distinction through CSS style.
There is a cite attribute in blockquote, which is used to indicate the source of the reference, just like q. You can specify the URL of the online document.
There is also a tag called pre in the XHTML tag. This tag is called formatting in Dreamweaver. When I used Dreamweaver, I didn't know what this thing is for. It was not until now that pre is usually used to display source code, and does not support tags that can separate paragraphs, such as <p>. If you need to display the content, just wrap the line in the source file, you can do no need for code to implement it. At the same time, pre will retain all spaces in the note and display them.
Generally speaking, pre is currently mostly used to display source code, which is similar to the use of code. The difference is that pre is block-level, while code is inline. Simply put, pre can include multiple lines of content, while code only contains a short sentence or a few characters.
What is told here cannot be fully explained. This requires you to try it out after reading the document and discover what is special by yourself. Some friends said they hope to see some knowledge about CSS. Here I want to convey my writing intention. I hope to take it step by step so that some friends who have not yet separated from the table layout can use some forms that will not affect the overall situation. Because there may be compatibility issues when CSS is involved, so let’s talk about the documentation first, and then add some CSS knowledge that does not affect the overall layout. Step by step, the readers can ultimately transition from the table layout to standard forces. Of course, some friends have completed this step through self-study, so you can go to my miscellaneous talk standards column to communicate with me.