19 Text Mastering Control

Source: Internet
Author: User
Tags define definition datetime html tags reference
Control

The br label is now overused, when the label is used to p represent the paragraph. You should use a label when you represent a paragraph p . In the same way, there are many tags that should be used to define reliable text elements, such as quotations, abbreviations abbreviations, and computer code computer codes.

It's important to note that while browsers can implement these tags in a variety of way, it's important to keep in mind that regardless of what each element looks like, be sure to be semantically correct.

Abbreviations abbreviations and acronyms only initials

abbrUsed for abbreviations, for acronyms that acronym take only the first letter

An abbreviation is an abbreviation of a phrase, which is very general, and an abbreviation that takes only the first letter is made up of the first letter of a phrase. So CSS is the correct acronym for just the initials, and HTML and XHTML are not (if ' Hypertext Markup Language ' takes the initials acronym IS ' HML ' the same XHTML is ' EHML ').

Apply the most appropriate usability, using the title abbreviation of the expression phrase, or just the initials of the first letter.

<abbr title="HyperText Markup Language">HTML</abbr><acronym title="Cascading Style Sheets">CSS</acronym>.</p>

For some inexplicable reason, ie browser does not support abbr tags, a friend named Marek Prokop use JavaScript to make it work, clever JavaScript workaround

There is a lot of controversy about the way the two are used. Lars Holst's article mentions the most detailed insight

Quotations the language of introduction

blockquote, p and cite used in reference language. blockquoteis a block element for a large reference, and q a row element for a small reference. The cite same is the line element, q more semantic than the future may be replaced q .

titleProperty can be used to indicate where the reference comes from.

qTags usually do not change the appearance of the text above, if you want to change can use CSS.

<cite>I know as much about quotations as I do about pigeon fancying</cite>. Luckily, I found HTML Dog and it said...</p><blockquote title="From HTML Dog, http://www.htmldog.com/"><p>blockquote, q and cite are used for quotations. blockquote is block-line and used for large or citations, whereas q is in-line and used for smaller phrases. cite is also in-line and preferable to q for its semantic nature and possible future deprecation of q.</p></blockquote>

Code codes

There are many tags, code and the var designation is used to represent the computer code. preand samp , they are also primarily used in code.

codeFor computer code.

varA description of the variables used in the code.

<code><var>ronankeatingisbland</var> = true;</code>

sampis similar to code, but it assumes an example of the output code.

preis a preformatted text that, in HTML tags, is unique in that it provides a white restricted area for code block display.

<pre><div id="intro"></pre>

Definition terms Define Terms

dfnIs the definition term used to highlight the first use of terminology. Like abbr and acronym , title attributes are used to describe terms.

<dfn title="Dog">canine</dfn><dfn title="Horse">equine</dfn><dfn title="A mutation that combines two or more sets of chromosomes from different species">allopolyploid</dfn> organism.</p>

Addresses address

addressUsed to represent an address.

<address>HMTL Dog House<br />HTML Street<br />Dogsville<br />HT16 3ML</address>

Obscure and rare label

Some labels are noteworthy but rarely used due to their own specificity.

bdoYou can invert the text and use it to show Right-to-left languages. Property dir Property Value ltr (left to right) or rtl (right to left) is required.

<bdo dir= "RTL" >god lmth</bdo>

kbdUsed to display text that needs to be typed.

<kbd>woo hoo</kbd></p>

insand del used to show the insertion and deletion of edited text, respectively. They have datetime attributes (YYYYMMDD format) and cite (a link to explain the reason for the insert deletion).

insElements usually display underscores, and del elements usually show strikethrough.

<del datetime="20030522">nonsense</del><ins cite="http://www.htmldog.com">very informative stuff</ins> that I've written.</p>

Performance elements

b,i,sub,big,smallare expressive elements that, through their definition, know that separation of semantics and expression should not be used again. The b definition is bold, without any semantics, and these tags are defined purely for visual features, those that can be replaced with CSS. The correct label is semantic, for example strong , and em represents a phrase element. If you want to copy the style of these labels by yourself and do not use any semantic tags, you should label them with CSS span .







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.