HTML5 structure and semantics (3): semantic block-level element _ html5 tutorial skills-

Source: Internet
Author: User
HTML5 also adds some purely semantic block-level elements: asidefiguredialog I have been using the first two elements in my articles and books. The third element is not commonly used. It is mainly used in written text. The asideaside element represents the description, prompt, sidebar, reference, and additional comments, that is, content outside the main line. For example, some purely semantic block-level elements are added to developer HTML5:
   Aside figure dialog
I have been using the first two elements in my articles and books. The third element is not commonly used. It is mainly used in written text.
Aside
The aside element represents the description, prompt, sidebar, reference, and additional comments, that is, content outside the main line. For example, in developerWorks articles, you will often see the sidebar written in the form of tables. For details, see the developerWorks sidebar written in code 3 in HTML4.






. Xf-value



The . Xf-valueSelectorusedherestylestheinput
Fieldvaluebutnotitslabel. Thisisactuallyinconsistent
WiththecurrentCSS3draft. Theexamplereallyshouldusethe
: ValuePseudo-classinsteadlikeso:




Input: value {width: 20em ;}
# Ccnumber: value {width: 18em}
# Zip: value {width: 12em}
# State: value {width: 3em}



However, firefoxdoesn' tyetsupportthissyntax.



In HTML5, you can write this sidebar in a more meaningful way. For details, refer to code 4. The developerWorks sidebar written in html5.

. Xf-value


The . Xf-valueSelectorusedherestylestheinput
Fieldvaluebutnotitslabel. Thisisactuallyinconsistent
WiththecurrentCSS3draft. Theexamplereallyshouldusethe
: ValuePseudo-classinsteadlikeso:



Input: value {width: 20em ;}
# Ccnumber: value {width: 18em}
# Zip: value {width: 12em}
# State: value {width: 3em}


However, firefoxdoesn' tyetsupportthissyntax.




The browser can decide where to put this sidebar (a little CSS code may be required ).
Figure
The figure element represents a block-level image and can contain instructions. For example, in many developerWorks articles, you can see the result of marking the developerWorks diagram written in HTML4 in code 5.
Figure2.InstallMozillaXFormsdialog

MozillaXForms0.7Unsigned"
Src = "installdialog.jpg" border = "0" height = "317" hspace = "5" vspace = "5" width = "331"/>



. InstallMozillaXFormsdialog

In HTML5, you can write this graph in a more semantic way. For details, see the developerWorks graph written in HTML5 in Code 6.

Figure2.InstallMozillaXFormsdialog
MozillaXForms0.7Unsigned"
Src = "installdialog.jpg" border = "0" height = "317" hspace = "5" vspace = "5" width = "331"/>


The most important thing is that browsers (especially screen readers) can explicitly link graphs and instructions.
The figure element not only displays images. You can also use it to describe audio, video, iframe, object, and embed elements.
Dialog
The dialog element indicates the dialog between several people. The HTML5dt element can represent the speaker, and the HTML5dd element can represent the speech content. Therefore, the dialog can be displayed in a reasonable way in the old-fashioned browser. Code 7 shows a famous conversation on Galileo's "DialogueConcerningtheTwoChiefWorldSystems.
Code 7. Galilean conversation written in HTML5

Simplicius

AccordingtothestraightlineAF,
Andnotaccordingtothecurve, suchbeingalreadyexcluded
Forsuchause.

Sagredo

ButIshouldtakeneitherofthem,
SeeingthatthestraightlineAFrunsobliquely. ishocould
DrawalineperpendiculartoCD, forthiswouldseemtome
Tobetheshortest, aswellasbeinguniqueamongthe
Infinitenumberoflongerandunequaloneswhichmaybe
DrawnfromthepointAtoeveryotherpointoftheopposite
Linmcm.

Salviati

Yourchoiceandthereasonyou
Adduceforitseemtomemostexcellent. Sonowwehaveit
Thatthefirstdimensionisdeterminedbyastraightline;
Thesecond (namely, breadth) byanotherstraightline, and
Notonlystraight, butatrightanglestothatwhich
Determinesthelength. Thuswehavedefinedthetwo
Dimensionsofasurface; thatis, lengthandbreadth.


Butsupposeyouhadtodetermineaheight-
Example, howhighthisplatformisfromthepavementdown
Belowthere. Seeingthatfromanypointintheplatformwe
Maydrawinfinitelines, curvedorstraight, andallof
Differentlengths, totheinfinitepointsofthepavement
Below, whichofalltheselineswouldyoumakeuseof?




There is still controversy over the accurate Syntax of this element. Some people want to embed non-conversational text in the dialog element (such as the stage description in the script), and others do not like to extend the functions of the dt and dd elements. Despite the controversy in the specific syntax, most people think that it is a good thing to express a conversation in such a semantic way.
  
(To be continued)

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.