Xhtml has many not commonly used but very useful tags. Some can achieve twice the result with half the effort, some can improve semantics, and some can improve ease of use. I have summarized some of the principles that are useful and useful, which means that most browsers must support it, otherwise it will not be counted as signing. What's the use of being able to sigh at the sign?
<base> tag effect:
Href: Link address
target: The target, its value can be _blank,_parent,_self,_top, and can be used in Strict mode. I first discovered this usage on 163.com.
usage:<head><!—写在head标签之间--><basehref=http://www.qq.com///><!—Define the default link as http://www.qq.com/-->
<basetarget=_blank/><!—Define the default link target as open in a new window-->
</head> <caption> tag
Function: The caption tag is used to define the title of the table. Define a title for the table to explain what the table is for. Isn’t it very semantic? Caption should be written after the table, and the default style is centered and displayed at the top of the table. You can change its style through css. usage:
<tablewidth=200border=1><caption><!--caption should be written after table-->
Actually, I'm caption
</caption>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table> <head> tag, <tbody> tag, <tfoot> tag
Function: the head, tfoot and tbody tags are the head of the table (many people just use the th), theme, and bottom. They can make the table more semantic, and also allow us to control the performance of the table more conveniently. Some people abroad use very abnormal methods to use these three tables to make the title and follow the table, or the tbody is fixed in height, and the number of extra rows appears scroll bars. If you are interested, you can search or do this.
Note: If you use the head, tfoot, and tbody elements, you must use all the elements. Their occurrence order is: head, tfoot, tbody, so that the browser can render the footer before receiving all data.
usage:
<tableborder=1><head>
<tr>
<th>Subject</th>
<th>Score</th>
</tr>
</head>
<tfoot>
<tr>
<td>Total Score</td>
<td>159</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>Chinese</td>
<td>99</td>
</tr>
<tr>
<td>Mathematics</td>
<td>60</td>
</tr>
</tbody>
</table> <fieldset> tags and <legend> tags
Function: The <fieldset> element is used to classify elements in a form, while <legend> can define a title for this group. You must have seen a layout similar to the following domo! They can also define styles through css. usage:
<form><fieldset>
<legend>Basic Information</legend>
Name:<inputtype=text/>
Gender:<inputtype=text/>
</fieldset>
</form> <sub> tags and <sup> tags
Function: The <sub> tag and <sub> tag are superscripts and subscripts respectively. Although they perform differently in each browser, you
They can also be defined using css.
usage:
2<sup>我是上标</sup>2<sub>I am a subscript</sub> <label> tags
Function: The use of label tags can expand the click area of the form to improve the ease of use of the form. Let’s take a look at the usage below: when clicking on text, it is equivalent to clicking on a single-choice control. Will the user experience be better? usage:
<form><labelfor=nan>Mr.</label>
<inputtype=radioname=sexid=nan/>
<br/>
<labelfor=nv>Ms.</label>
<inputtype=radioname=sexid=nv/>
</form>
<optgroup> tag effect: Tags can group options in select, which is very useful when pulling down items in many ways. Naming each group with label tags. You can also define different colors for each group using css like Taobao. usage:
<select><optgrouplabel=self-driving tour><!--Name each group with label label-->
<option>In-province</option>
<option>Outside the province</option>
</optgroup>
<optgrouplabel=Travel Agency>
<option>In-province</option>
<option>Outside the province</option>
<option>Foreign</option>
</optgroup>
</select>
If you are interested in more xhtml tags, you can consider reading the book "The Authoritative Guide to HTML and XHTML", and you can also find the electronic version online. I've seen the English photocopy version, although it's in English, it's not too difficult to understand.
If you know other useful tags, let us know!