Home Web Front-end H5 Tutorial How to use h5 organized content

How to use h5 organized content

Jan 12, 2018 am 09:49 AM
html5 use how


This time I will show you how to use h5 organizational content, how to use h5 organizational content? What are the precautions when using h5 to organize content? The following is a practical case, let’s take a look.

By default, the format of HTML document is not related to the format of the document content displayed in the browser window. For example: the browser will connect several white space characters together. Converts to a space, and newlines are ignored. HTML provides a way to organize content, segment displayed content, pre-format content, etc.

Create paragraphs

HTML will ignore carriage returns and other extra spaces you enter in the text. New paragraphs in the web page are marked with the p element. A paragraph contains one or more Related sentences usually revolve around a point or argument, or there are some common themes among multiple arguments.

<body> 
    <h1>Antoni Gaudí</h1> 
    <p>Many tourists are drawn to Barcelona 
       to see Antoni Gaudí&#39;s incredible 
       architecture.</p> 
    <p>Barcelona celebrated the 150th 
       anniversary of Gaudí&#39;s birth in 
       2002.</p> 
</body>
Copy after login

You can add styles to paragraphs, including fonts, font sizes, colors, etc.

div element

The div element has no specific meaning. If no appropriate element is available, you can use this element to structure the content and give it meaning. Its meaning is usually through the class or id attribute. specified.

But note that it is best not to use div elements as a last resort. Priority should be given to elements with semantic importance.

Pre-formatted content

The browser will compress all extra carriage returns and spaces and automatically wrap lines according to the size of the window. The pre element can change the way the browser handles content, preventing whitespace characters from being merged so that the formatting in the source document is preserved. Note, however, that it is best not to use this element unless it is necessary to preserve the original formatting of the document, because it reduces the flexibility of the mechanism to control the rendering results through the use of elements and styles. The

pre element is usually used in conjunction with the code element to display code examples, because formatting in programming languages is usually important.

<p>Add this to your style sheet if you want 
  to display a dotted border underneath the 
  <code>abbr</code> element whenever it has 
  a <code>title</code> attribute.</p> 
<pre class="brush:php;toolbar:false"> 
    <code> 
        abbr[title] { 
            border-bottom: 1px dotted #000; 
        } 
    </code> 
Copy after login

Quoting content from elsewhere

The blockquote element represents a piece of content quoted from elsewhere, similar to the q element (used for short quotes, cannot cross lines), but is usually used in quotations Scenes with a lot of content. The cite attribute of this element can be used to specify the source of the content being quoted.

Add topic separation

The hr element represents paragraph-level topic separation. In HTML5, the hr element represents a transition to another related topic, and the custom style is a straight line across the page.

Note that the browser will ignore the format of the content in the blockquote element and indent the blockquote text by default. To establish structure in a quote, you can use some organizational elements such as p or hr.

Browsers will automatically add language-specific quotation marks to the text in the q element, but the effects of different browsers will vary. Below is an example using the q element.

<p>She tried again, this time in French: 
<q lang="fr">Avez-vous lu le livre
<cite lang="en">High Tide in Tucson</cite>
de Kingsolver? C&#39;est inspirational.</q></p>
<blockquote cite="http://en.wikipedia.org/wiki/Apple">
Copy after login

Topic 1


Topic 2


……

The above example adds some hr elements to the blockquote element to form a certain structure.

Organize content into lists

The types of lists in HTML include ordered lists, unordered lists, and description lists.

1) Ordered list, ol is the parent element, li is the list item;

2) Unordered list, ul is the parent element, li is the list item;

3) Description list, dl is the parent element, dt and dd represent terms and descriptions in dl respectively.

In addition to this, users can also define their own lists.

I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

How to use video and audio tags and progress bars in H5

How to implement drag-and-drop function in H5

H5 Semantic Tag Actual Case

The above is the detailed content of How to use h5 organized content. For more information, please follow other related articles on the PHP Chinese website!

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)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

See all articles