Table of Contents
.xf-value
Home Web Front-end H5 Tutorial Structure and semantics of HTML5 (3): Semantic block-level elements_html5 tutorial skills

Structure and semantics of HTML5 (3): Semantic block-level elements_html5 tutorial skills

May 16, 2016 pm 03:51 PM
element Can structure write Semantics

HTML5 also adds some purely semantic block-level elements:
aside figure Dialog
I have been using the first two elements in articles and books. The third element I don't use very often, it's mainly used for written text.
aside
The aside element represents instructions, tips, sidebars, quotes, additional notes, etc., that is, content outside the main line of the narrative. For example, in developerWorks articles, you often see sidebars written in table format. See Code 3 for developerWorks sidebars written in HTML4.


Structure and semantics of HTML5 (3): Semantic block-level elements_html5 tutorial skills



.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}

Structure and semantics of HTML5 (3): Semantic block-level elements_html5 tutorial skills




.xf-value
The.xf-valueselectorusedherestylestheinputfieldvaluebutnotitslabel. ThisisactuallyinconsistentwiththecurrentCSS3draft.Theexamplereallyshouldusethe::valuepseudo-classinsteadlikeso:input::value{width:20em;}
#ccnumber::value{width:18em}
#zip::value{width:12em}
#state::value{width:3em}
However, Firefox doesn't support this syntax.
In HTML5, this sidebar can be written in a more meaningful way, see Code 4 developerWorks sidebar written in HTML5.


The browser can decide where to place this sidebar (maybe with a little CSS code).
figure
The figure element represents a block-level image and can also contain descriptions. For example, in many developerWorks articles, you can see code 5 developerWorks diagram written in HTML4 with such markup. The result is shown in Figure 1.
Figure2.InstallMozillaXFormsdialog

Structure and semantics of HTML5 (3): Semantic block-level elements_html5 tutorial skillsMozillaXForms0.7Unsigned"
border="0"height ="317"hspace="5"vspace="5"width="331"/>



Figure 1.InstallMozillaXFormsdialog

In HTML5, this diagram can be written in a more semantic way, see code 6 developerWorks diagram written in HTML5.

Figure2.InstallMozillaXFormsdialog
Structure and semantics of HTML5 (3): Semantic block-level elements_html5 tutorial skillsMozillaXForms0.7Unsigned"
border="0"height="317 "hspace="5"vspace="5"width="331"/>


Most importantly, browsers (especially screen readers) can clearly link the figures and descriptions together.
The figure element can not only display pictures. You can also use it to add descriptions to audio, video, iframe, object, and embed elements.
dialog
The dialog element represents a conversation between several people. The HTML5dt element can represent the speaker, and the HTML5dd element can represent the speech content. Therefore, the conversation can be displayed in a reasonable manner in older browsers. Code 7 shows a famous dialogue from Galileo's "Dialogue Concerning the Two Chief World Systems".
Code 7. Galilean dialogue written in HTML5

Simplicius

AccordingtothestraightlineAF,
andnotaccordingtothecurve,suchbeingalreadyexcluded
forsuchause.

Sagredo

ButIshouldtakeneitherofhem,
seeingthatthestraightlineAFrunsobliquely.Ishould
drawalineperpendiculartoCD,forthiswouldseemtome
tobetheshortest,aswellasbeinguniqueamongthe
infinitenumberoflongerandunequaloneswhichmaybe
drawnfromthepointAtoeveryotherpointoftheopposite
lineCD.

Salviati

Yourchoiceandthereasonyou
addforitseemtomemostexcellent.Sonowwehaveit
thatthefirstdimensionisdeterminedbyastraightline;
th esecond(namely,breadth)byanotherstraightline,and
notonlystraight,butatrightanglestothatwhich
determinesthelength.Thuswehavedefinedthe two
dimensionsofasurface;thatis,lengthandbreadth .


But suppose you had to determine the height—for
example,howhighthisplatformisfromthepavementdown
belowthere.Seeingthatfromanypointintheplatformwe
maydrawinfinitelines, curvedorstraight,andallof
differentlengths,totheinfinitepointsofthepavement
below, which of these lines would you make use of?




There is debate over the exact syntax of this element. Some people want to embed non-dialog text (such as stage directions in a script) within the dialog element, and others don't like to extend the role of the dt and dd elements. Although there are arguments over the specific syntax, most people agree that expressing dialogue in this semantic way is a good thing.
 
 (To be continued)

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to write Bloom filter algorithm using C# How to write Bloom filter algorithm using C# Sep 21, 2023 am 10:24 AM

How to use C# to write a Bloom filter algorithm. The Bloom Filter (BloomFilter) is a very space-efficient data structure that can be used to determine whether an element belongs to a set. Its basic idea is to map elements into a bit array through multiple independent hash functions and mark the bits of the corresponding bit array as 1. When judging whether an element belongs to the set, you only need to judge whether the bits of the corresponding bit array are all 1. If any bit is 0, it can be judged that the element is not in the set. Bloom filters feature fast queries and

Can I delete the downloads folder? Can I delete the downloads folder? Feb 19, 2024 pm 03:38 PM

Can downloads be deleted? In recent years, with the advent of the digital age, more and more digital products and services have appeared in our lives. What follows is that our demand for digital content is increasing day by day. In our daily life and work, we often need to download a variety of files, such as documents, pictures, audios, videos, etc. These downloaded files are usually saved in a folder called "downloads". However, over time we often find that,"

Write a method to calculate power function in C language Write a method to calculate power function in C language Feb 19, 2024 pm 01:00 PM

How to write exponentiation function in C language Exponentiation (exponentiation) is a commonly used operation in mathematics, which means multiplying a number by itself several times. In C language, we can implement this function by writing a power function. The following will introduce in detail how to write a power function in C language and give specific code examples. Determine the input and output of the function The input of the power function usually contains two parameters: base and exponent, and the output is the calculated result. therefore, we

Which games are suitable for playing with i34150 and 1G independent graphics (which games is suitable for i34150) Which games are suitable for playing with i34150 and 1G independent graphics (which games is suitable for i34150) Jan 05, 2024 pm 08:24 PM

What games can be played with i34150 with 1G independent graphics? Can it play small games such as LoL? GTX750 and GTX750TI are very suitable graphics card choices. If you just play some small games or not play games, it is recommended to use the i34150 integrated graphics card. Generally speaking, the price difference between graphics cards and processors is not very big, so it is important to choose a reasonable combination. If you need 2G of video memory, it is recommended to choose GTX750TI; if you only need 1G of video memory, just choose GTX750. GTX750TI can be seen as an enhanced version of GTX750, with overclocking capabilities. Which graphics card can be paired with i34150 depends on your needs. If you plan to play stand-alone games, it is recommended that you consider changing the graphics card. you can choose

How to write a simple hotel reservation system using C++? How to write a simple hotel reservation system using C++? Nov 03, 2023 am 11:54 AM

The hotel reservation system is an important information management system that can help hotels achieve more efficient management and better services. If you want to learn how to use C++ to write a simple hotel reservation system, then this article will provide you with a basic framework and detailed implementation steps. Functional Requirements of a Hotel Reservation System Before developing a hotel reservation system, we need to determine the functional requirements for its implementation. A basic hotel reservation system needs to implement at least the following functions: (1) Room information management: including room type, room number, room

How to write a dynamic programming algorithm using C# How to write a dynamic programming algorithm using C# Sep 20, 2023 pm 04:03 PM

How to use C# to write dynamic programming algorithm Summary: Dynamic programming is a common algorithm for solving optimization problems and is suitable for a variety of scenarios. This article will introduce how to use C# to write dynamic programming algorithms and provide specific code examples. 1. What is a dynamic programming algorithm? Dynamic Programming (DP) is an algorithmic idea used to solve problems with overlapping subproblems and optimal substructure properties. Dynamic programming decomposes the problem into several sub-problems to solve, and records the solution to each sub-problem.

How to write a simple minesweeper game in C++? How to write a simple minesweeper game in C++? Nov 02, 2023 am 11:24 AM

How to write a simple minesweeper game in C++? Minesweeper is a classic puzzle game that requires players to reveal all the blocks according to the known layout of the minefield without stepping on the mines. In this article, we will introduce how to write a simple minesweeper game using C++. First, we need to define a two-dimensional array to represent the map of the Minesweeper game. Each element in the array can be a structure used to store the status of the block, such as whether it is revealed, whether there are mines, etc. In addition, we also need to define

How to use C++ to write a simple student course selection system? How to use C++ to write a simple student course selection system? Nov 02, 2023 am 10:54 AM

How to use C++ to write a simple student course selection system? With the continuous development of technology, computer programming has become an essential skill. In the process of learning programming, a simple student course selection system can help us better understand and apply programming languages. In this article, we will introduce how to use C++ to write a simple student course selection system. First, we need to clarify the functions and requirements of this course selection system. A basic student course selection system usually includes the following parts: student information management, course information management, selection

See all articles