


Structure and semantics of HTML5 (3): Semantic block-level elements_html5 tutorial skills
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.
The
fieldvaluebutnotitslabel.Thisisactuallyinconsistent
withthecurrentCSS3draft.Theexamplereallyshouldusethe
#ccnumber::value{width:18em}
#zip::value{width:12em}
#state::value{width:3em}
The However, Firefox doesn't support this syntax.
#ccnumber::value{width:18em}
#zip::value{width:12em}
#state::value{width:3em}
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.
MozillaXForms0.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.
MozillaXForms0.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
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)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



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 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,"

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

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

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 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++? 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? 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
