For a while, it has been found that many users do not use XHTML. Not only are they Common beginners, but some programmers do not know how to write this XHTML, I will summarize some common application problems here, so that everyone can have a tacit understanding in communication and cooperation.
There are many tags in XHTML, but they are often used as long as they are mastered. The following lists div, p, span, ul, li, dl, dt, dd, a, img, h, strong, em.
In my mind, div is always a bottle or a box. I think it is hard. This div has no special meaning and can be used in many places, that is, it can be used to install different things. The correct syntax is that <div> </div> must be sealed. We use it for layout and also for storing articles to form paragraphs. In fact, this practice is not very good, because there is a specific label to use as part of the article. That is the <p> </p> label to be discussed below, but the section where the whole package is stored is used with DIV. This is very practical.
P is a tag with specific semantics. It indicates a paragraph and is used to distinguish a paragraph. In most browsers, P basically has an upper and lower margin. But there is no line first indent, because the line first indent only indicates the paragraph method, but not necessarily or necessary. Therefore, if you need to use the P tag, you can set the first line indent for P. I recommend that you do not use P outside of the article, because P has certain semantics, it may be inappropriate to use it elsewhere. <P> </p>
Span is also a very common label. It can be said that it is very similar to div and has no specific meaning, but it is a cascading element rather than a block-level element. I always think of it as a bag. Unlike a box, he can have his own width and height. His width and height can only vary with the content, so it is like a bag. This label is complementary to div.
Ul and li are a list. In the list, apart from UL and OL, I think OL is a little like a chicken rib. Because UL can have the OL numeric sorting effect as defined by CSS. So I generally do not recommend using OL, so UL is enough. UL is block-level, and its sub-level li is also a block-level label. The correct syntax is that the <ul> <li> </ul> LI label is wrapped by the UL label, and there can be no more LI labels in the UL label, LI tags cannot be used independently. And the LI tag must be sealed. This is not just a matter of appearance, but also very beneficial for later maintenance. Many programmers do not like to seal this LI. The use of the UL list is mainly to list one-dimensional data of the same type. For example, you can use the menu or the number of columns in the document. There is a special form in the list that is different from UL. That is the DL below.
Dl, dt, and dd are a special combination of three tags. Here, DT refers to the title and DD refers to the content. DL is the container for package classes. The correct syntax is <dl> <dt> </dt> <dd> </dl> There are many groups of DT, DD, when there are many groups, try to configure a DT with a DD. If there is a lot of content in the DD, you can add the P tag in the DD for use. The DL list is a very good list form and can be used more.
A indicates the link, which is a specific attribute and the most amazing tag on the webpage. Because of this, countless web pages are connected together. The correct syntax is: <a href = "" title = ""> </a> The href indicates the target address, and the TITLE indicates the text of the mouse hover prompt, which is dispensable. However, the benefits must be greater than none.
Img is an image tag and a tag of a specific attribute. Normal syntax: Here, src is the target address, ALT and TITLE are replaced with text, and ALT is specified by IE, TITLE is common to other browsers. But remember that the backslash at the end must be there.
H: this is a series of labels. From H1 to H6, there are a total of six. Some people say it is too little, some say it is very useful, and some say it cannot be used so much. I think it's similar. The correct syntax is:
Strong indicates that it is semantic and has a very simple effect. As for the example, whether it is bold or highlighted by color, it is your choice. The correct syntax is <strong> </strong>
Em, which is similar to strong, indicates emphasis. Generally, the default value of the browser is italic. The usage is the same as that of strong. Statement: <em> </em>
The form is not mentioned here, because the form is basically unchanged and there is nothing to mention.