The purpose of marking content with HTML is to give the web page semantics. In other words, you need to give your web page content some meaning that the user agent can understand.
HTML specifies a set of tags to mark content differently. Each tag is a description of what it contains. The most commonly used HTML descriptions are titles, paragraphs, links and pictures. Currently, HTML has a total of 114 tags, but according to the 80/20 principle, using about 25 of them can meet 80% of markup needs.
The latest version of HTML, HTML5, stipulates a new batch of structured tags, which are used to group tags of related content to better standardize the overall structure of the web page. These new tags include
1. Closure of tags
For each content-containing element (such as title, paragraph, and picture), there are two different ways to give it depending on whether the content it contains is text. They are tagged, one with a closing tag and the other with an unclosing tag.
1.1 Use closing tags for text
Example:
Hello, CSS!
1.2 Use self-closing tags for quoted content
Example:
Tips:
For self-closing tags, XHTML requirements must be written like this:
XML/HTML Code copies the content to the clipboard
<img src="/static/imghwm/default1.png" data-src="images/dog.jpg" class="lazy" alt="This is my dog." />
In HTML5, you can omit the last closing slash and write:
XML/HTML CodeCopy content to the clipboard
<img src="/static/imghwm/default1.png" data-src="images/dog.jpg" class="lazy" alt="This is my dog." >
2. Attribute
Tip: Screen readers used by visually impaired users will read the content of the alt attribute out loud, so be sure to give it The
alt attribute of the tag adds content that people can understand at a glance (or at a glance).
3. Titles and paragraphs
4. Composite elements
HTML not only specifies basic content tags such as titles, pictures, and paragraphs, but also specifies rules for creating lists,
Tables Tags for complex user interface components such as tables and forms. These are so-called composite elements, that is, they are composed of multiple
tags.
5. Nested tags
Simply put, it is to nest one tag inside another tag.
6.HTML5 Template
XML/HTML Code Copy content to the clipboard
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>An HTML Template</title> </head> <body> <!-- 这里是网页内容 --> </body> </html>
7. Block-level elements and inline elements
Document flow effect: HTML elements will They flow from the top of the page to the bottom in the order in which they appear in the markup.
The display attribute of almost all HTML elements is either block or inline. The most obvious exception is the table element, which has its own custom display value.
Block-level elements (such as headings and paragraphs) are stacked on top of each other and arranged down the page, each element occupying its own line. Inline elements (such as links and images) will be juxtaposed with each other, and will be folded to the next line only if there is not enough space to juxtapose.
No matter which HTML element you want to know about, the first question to ask should be: Is it a block-level element, or an inline element? Once you know this, you can anticipate how an element will be positioned in its initial state when writing markup, so that you can further think about how to reposition it using CSS in the future.
There are two things to know:
The block-level element box will expand to the same width as the parent element.
Inline element boxes will shrink-wrap their contents as tightly as possible.
7. Nested elements
The HTML tags are nested in the mark, and the boxes are nested on the screen.
8. DocumentObjectModel
The Document Object Model (DOM for short) observes the elements in the page and each element from the perspective of the browser attributes, resulting in a family tree of these elements. Through the DOM, the interrelationships between elements can be determined. By referencing a specific location in the DOM
in CSS, you can select the corresponding HTML element and modify its style attributes.
CSS The process of manipulating the DOM is to first select an element or a group of elements, and then modify the properties of these elements. After an element is modified through CSS, such as changing the width or inserting a pseudo-element in the markup, these changes will immediately occur in the DOM and be reflected on the page.
In short, it is to build the DOM through HTML tags, and then use CSS to modify the DOM when the page is first loaded and when the user interacts with the page.
The above is the detailed content of Introducing markup and document structure in html. For more information, please follow other related articles on the PHP Chinese website!

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The role of HTML is to define the structure and content of a web page through tags and attributes. 1. HTML organizes content through tags such as , making it easy to read and understand. 2. Use semantic tags such as, etc. to enhance accessibility and SEO. 3. Optimizing HTML code can improve web page loading speed and user experience.

HTMLisaspecifictypeofcodefocusedonstructuringwebcontent,while"code"broadlyincludeslanguageslikeJavaScriptandPythonforfunctionality.1)HTMLdefineswebpagestructureusingtags.2)"Code"encompassesawiderrangeoflanguagesforlogicandinteract

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

Atom editor mac version download
The most popular open source editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Zend Studio 13.0.1
Powerful PHP integrated development environment

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software