Brief introduction and simple demonstration of HTML commonly used tags

Previous article 【Portal】 Introduced the simple use of html

Here are some commonly used tags

Text category

Tell the browser what (protocol?) To parse and configure by setting the tag properties

<!DOCTYPE html>

Encoding category

Tell the browser what the encoding method is, generally default UTF-8, configured by setting the tag attribute

<meta charset="utf-8">

Language type (attribute of html tag

Tell the browser what language the page is in, to facilitate the work of its translation plugin, and html标签configure it by setting properties

<html lang="zh-CN">
en = 英语
zh-CN = 中文

Large structure label

Required structure

<head>
	<title> </title>
</head>
<body>

</body>
</html>

Title tag

Paired tags, divided into h1-h6 corresponding to 1-6 level headings

<h1> </h1>
<h2> </h2>
<h3> </h3>
<h4> </h4>
<h5> </h5>
<h6> </h6>

Paragraph tag

<p> <p> p = paragraphs, the content in the middle will be displayed as a paragraph

<p> <p>

Box split label

<div> </div> div = division, division, one div occupies a whole horizontal area

<span> </span> A row can be occupied by multiple spans

<div> </div>

<span> </span>

Line break

<br> br = break line break

<br>

Picture tags

<img> img = image Image, image tag has some attributes, such as source, length, width, border, etc., where source is required

<img src="图片路径">

link

<a> </a> a = anchor Anchor point, which is the anchor point for searching, has the meaning of link, and also has some attributes, such as herf points to the linked object, target means the pop-up method, which can be a local web page, online web page

The content between the two tags will be used as a hyperlink, that is, an object that can be clicked, such as text or pictures

Demo

<!DOCTYPE html>
<html lang="zh-CN">
<meta charset="utf-8">
<head>
	<title>这是title</title>
</head>
<body>
	<h1>这是一个一级标题</h1>
	<h2>这是一个二级标题</h2>
	<p>这是段落 1</p>
	<p>这是段落 2</p>
	<div>这是div块的区域</div>
	<span>这是span块1的区域</span>
	<span>这是span块2的区域</span>
	<div>
	<img src="2.jpg" width="100" height="100">
	</div>
	<a href="helloworld.html" target="view_window">点我跳转到helloworld</a>
</body>
</html>

Insert picture description here

Published 262 original articles · won 11 · 10 thousand views

Guess you like

Origin blog.csdn.net/weixin_44176696/article/details/105478895