Home Web Front-end H5 Tutorial HTML5 study notes (2) - detailed introduction to elements, attributes, and formatting

HTML5 study notes (2) - detailed introduction to elements, attributes, and formatting

Mar 16, 2017 pm 03:33 PM
element Attributes format

HTML element


## The element refers to all code from the start tag to the end tag .

Start (open) tagElement contentEnd (close) tag

this is my web page

## An HTML element without content is called is an empty element. Empty elements are closed in the opening tag.


is an empty element without a closing tag (
tag definition wraps).

In XHTML,

XML

, and future versions of HTML, all elements must be closed. Adding a slash in the opening tag, such as
, is the correct way to close an empty element, and is accepted by HTML, XHTML, and XML.

Even though
is valid in all browsers, using
is actually a longer-term guarantee.

HTML element syntax

## The content of element
is the content between the start tag and the end tag

Empty elements are closed in the opening tag

Most HTML elements can have

attributes

Nested HTML elements

Most HTML elements can be nested

<p>Hello world, <a>找度娘</a></p>
Copy after login

HTML attributes 1. Tags can have attributes to provide more information for elements


2. Attributes appear in the form of key-value pairs, such as: href = "www.cnblogs. www/winsoncheung"

3. Commonly used tag attributes:

#  :target specifies where to open the connection

4. Common attributes:

class
Specifies the class name of the element

id
Specifies the unique ID of the element
styleSpecify the style of the element
titleSpecify the additional information of the element
<!DOCTYPE html><html><head>
    <meta charset="UTF-8">
    <!--id规定元素唯一ID-->
    <title id="1223">基础</title>
    <!--style规定元素的样式-->
    <style type="text/css"></style></head><body bgcolor="#5f9ea0">
    <h1 align="center">标题1</h1>
    <a href="index02.html" target="_blank">打开本地</a>
    <!--class规定元素类名-->
    <h2 class="h2ID">标题2</h2></body></html>
Copy after login

HTML格式化


文本格式化标签:

标签描述
定义粗体文本。
定义大号字。
定义着重文字。
定义斜体字。
all>定义小号字。
定义加重语气。
定义下标字。
定义上标字。
定义插入字。
定义删除字。
不赞成使用。使用 代替。
不赞成使用。使用 代替。
不赞成使用。使用样式(style)代替。

“计算机输出”标签:

标签描述
定义计算机代码。
定义键盘码。
定义计算机代码样本。
定义打字机代码。
定义变量
</td><td style="margin-left: 30px">定义预格式文本。</td></tr><tr style="margin-left: 30px"><td style="margin-left: 30px"><<a href="http://www.php.cn/wiki/1059.html" target="_blank">list</a>ing></td><td style="margin-left: 30px">不赞成使用。使用 <pre class="brush:php;toolbar:false"> 代替。</td></tr><tr style="margin-left: 30px"><td style="margin-left: 30px"><plaintext></td><td style="margin-left: 30px">不赞成使用。使用 <pre class="brush:php;toolbar:false"> 代替。</td></tr><tr style="margin-left: 30px"><td style="margin-left: 30px"><xmp></td><td style="margin-left: 30px">不赞成使用。使用 <pre class="brush:php;toolbar:false"> 代替。</td></tr></tbody></table><p style="margin-left: 30px; text-align: left;"><a href="http://www.php.cn/wiki/231.html" target="_blank">引用</a>、引用和术语定义</p><table style="margin-left: 30px; height: 261px; width: 331px"><tbody style="margin-left: 30px"><tr style="margin-left: 30px" class="firstRow"><th style="margin-left: 30px">标签</th><th style="margin-left: 30px">描述</th></tr><tr style="margin-left: 30px"><td style="margin-left: 30px"><abbr></td><td style="margin-left: 30px">定义缩写。</td></tr><tr style="margin-left: 30px"><td style="margin-left: 30px"><acronym></td><td style="margin-left: 30px">定义首字母缩写。</td></tr><tr style="margin-left: 30px"><td style="margin-left: 30px"><address></td><td style="margin-left: 30px">定义地址。</td></tr><tr style="margin-left: 30px"><td style="margin-left: 30px"><bdo></td><td style="margin-left: 30px">定义文字方向。</td></tr><tr style="margin-left: 30px"><td style="margin-left: 30px"><blockquote></td><td style="margin-left: 30px">定义长的引用。</td></tr><tr style="margin-left: 30px"><td style="margin-left: 30px"><q></td><td style="margin-left: 30px">定义短的引用语。</td></tr><tr style="margin-left: 30px"><td style="margin-left: 30px"><cite></td><td style="margin-left: 30px">定义引用、引证。</td></tr><tr style="margin-left: 30px"><td style="margin-left: 30px"><dfn></td><td style="margin-left: 30px">定义一个定义项目。</td></tr></tbody></table><p style="margin-left: 30px; text-align: left;"> 代码示例:</p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><!DOCTYPE html><html><head>
    <meta charset="UTF-8">
    <title id="1223">格式化</title></head><body>
    <b>My name is Winson</b>
    <br/>
    <big>Welcome to my blog~</big>
    <br/>
    <i>Hello, visitor!</i>
    <br/>
    <small>我很小, 你看不见 看不见</small>
    <br/>
    <strong>太显眼了</strong>
    <br/>
    大家好<sub>欢迎</sub>来到    <br/>
    大家好<sup>欢迎</sup>来到    <br/>
    <ins>Come on! girls!</ins>
    <br/>
    <del>Hei! girl!</del></body></html>
Copy after login


The above is the detailed content of HTML5 study notes (2) - detailed introduction to elements, attributes, and formatting. 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)

How to format c drive with dos command How to format c drive with dos command Feb 19, 2024 pm 04:23 PM

DOS command is a command line tool used in Windows operating system, which can be used to perform various system management tasks and operations. One of the common tasks is to format the hard drive, including the C drive. Formatting the C drive is a relatively dangerous operation because it will erase all data on the C drive and reinitialize the file system. Before performing this operation, make sure you have backed up important files and have a clear understanding of the impact that formatting will have on your computer. The following is formatted in the DOS command line

Revealed secrets of cell phone format recovery methods (mobile phone malfunction? Don't worry) Revealed secrets of cell phone format recovery methods (mobile phone malfunction? Don't worry) May 04, 2024 pm 06:01 PM

Nowadays, we will inevitably encounter some problems such as being unable to turn on the phone or lagging, such as system crash, but during use, mobile phones have become an indispensable part of our lives. We are often at a loss, and sometimes, there are no solutions to these problems. To help you solve cell phone problems, this article will introduce you to some methods of cell phone format recovery and restore your phone to normal operation. Back up data - protect important information, such as photos and contacts, from being lost during the formatting process. Before formatting your phone, the first thing to consider is to back up important data and files on your phone. To ensure data security, or choose to transfer files to a cloud storage service, you can back it up by connecting to a computer. Use the system's built-in recovery function - simple

Will formatting a laptop make it faster? Will formatting a laptop make it faster? Feb 12, 2024 pm 11:54 PM

Will formatting a laptop make it faster? If you want to format your Windows laptop but want to know if it will make it faster, this article will help you know the right answer to this question. Will formatting a laptop make it faster? There are many reasons why users format their Windows laptops. But the most common reason is slow performance or speed of your laptop. Formatting a laptop will completely delete all data stored on the C drive or the hard drive partition where Windows operating system is installed. Therefore, every user will think twice before taking this step, especially when it comes to the performance of the laptop. This article will help you understand whether formatting your laptop will speed it up. Formatting your laptop helps

What are the methods of html formatting? What are the methods of html formatting? Mar 08, 2024 am 09:53 AM

HTML formatting method: 1. Use online HTML formatting tools; 2. Use the HTML formatting shortcut keys that come with the code editor, such as Shift + Alt + F in Visual Studio Code; 3. Use plug-ins, such as Sublime Text HTML/CSS/JS Prettify plug-in; 4. Use command line tools, such as HTML Tidy; 5. Manual formatting according to coding standards and habits.

bottom attribute syntax in CSS bottom attribute syntax in CSS Feb 21, 2024 pm 03:30 PM

Bottom attribute syntax and code examples in CSS In CSS, the bottom attribute is used to specify the distance between an element and the bottom of the container. It controls the position of an element relative to the bottom of its parent element. The syntax of the bottom attribute is as follows: element{bottom:value;} where element represents the element to which the style is to be applied, and value represents the bottom value to be set. value can be a specific length value, such as pixels

Introduction to the attributes of Hearthstone's Despair Thread Introduction to the attributes of Hearthstone's Despair Thread Mar 20, 2024 pm 10:36 PM

Thread of Despair is a rare card in Blizzard Entertainment's masterpiece &quot;Hearthstone&quot; and has a chance to be obtained in the &quot;Wizbane's Workshop&quot; card pack. Can consume 100/400 arcane dust points to synthesize the normal/gold version. Introduction to the attributes of Hearthstone's Thread of Despair: It can be obtained in Wizbane's workshop card pack with a chance, or it can also be synthesized through arcane dust. Rarity: Rare Type: Spell Class: Death Knight Mana: 1 Effect: Gives all minions a Deathrattle: Deals 1 damage to all minions

How to tell if a jQuery element has a specific attribute? How to tell if a jQuery element has a specific attribute? Feb 29, 2024 am 09:03 AM

How to tell if a jQuery element has a specific attribute? When using jQuery to operate DOM elements, you often encounter situations where you need to determine whether an element has a specific attribute. In this case, we can easily implement this function with the help of the methods provided by jQuery. The following will introduce two commonly used methods to determine whether a jQuery element has specific attributes, and attach specific code examples. Method 1: Use the attr() method and typeof operator // to determine whether the element has a specific attribute

How to format and reinstall the win10 system_Format and reinstall the win10 system tutorial How to format and reinstall the win10 system_Format and reinstall the win10 system tutorial Mar 21, 2024 pm 04:56 PM

Nowadays, the security of Windows 10 system computers is threatened by many viruses and programs. Let’s take a typical example. When he is surfing the Internet, he will unintentionally open a link or website, and then some very annoying advertisements will pop up on our computer inexplicably. Or if the computer is stuck in the interface and cannot move, it is likely that some software has been maliciously bundled and installed. Another situation is that there is a virus in the computer. If this kind of problem occurs, we can reinstall the system on the win10 computer, which can effectively remove the virus programs in the system disk. Now the editor will show you how to format and reinstall the win10 system. Let's read on. . 1. How to format and reinstall the win10 system? First, we click &quot;Start&quot; -

See all articles