Introduction to HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>title</title>
</head>
<body>
<h1>我的第一个标题</h1>
<p>我的第一个段落</p>
</body>
</html>
Element explanation:
Declare that the HTML5 document element is the root element of the HTML page. The element contains the meta data of the document, such as defining the encoding format of the web page as utf-8.element:元素描述了文档的标题 元素包含了可见的页面内容 <h1> 元素定义一个大标题 <p> 元素定义一个段落 </p></h1>
label element
element defines the entire HTML document.label element
Elements define the body of an HTML document.-
label element
Decrease in size from 1-6
<h1>这是一个标题</h1>
<h2>这是一个标题</h2>
<h3>这是一个标题</h3>
label element
declare a paragraph
<!--style设置样式-->
<p style="color:red;" >哈哈哈哈</p>
label element
define horizontal line
<p style="color:red;" >哈哈哈哈</p><hr>
<p style="color:red;" >哈哈哈哈2</p>
label element
new line
Text formatting tag element
Label | describe |
---|---|
b | define bold text |
em | define emphatic text |
i | define italics |
small | define small font |
strong | Define Emphasis |
sub | define subscript |
sup | define superscript |
ins | define caret |
of the | define delete word |
label element
src="https://gimg3.baidu.com/search/src=http%3A%2F%2Fpics7.baidu.com%2Ffeed%2F2cf5e0fe9925bc31a19293177f1058bbc9137048.jpeg%3Ftoken%3D92e90a207b6a41c3ea25055686f26d32&refer=http%3A%2F%2Fwww.baidu.com&app=2021&size=f360,240&n=0&g=0n&q=75&fmt=auto?sec=1661274000&t=e0ada1a2a7ec9d4626ed370549f3ef84" alt="new" width="304" height="228">
label element
HTML links are defined by tags.
<a href="https://www.baidu.com">百度一下</a>
Attributes of the a element:
Attributes | describe |
---|---|
class | Define one or more class names (classname) for html elements (class names are imported from style files) |
id | Define the unique id of the element |
style | Specifies the inline style of an element |
title | Describes additional information about the element (used as a toolbar) |
Anchor link for a tag
<a href="#ti">跳转到标题</a>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<h1 id="ti">我是标题</h1>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
<p>我是内容</p>
The combination of a element and img element
<a href="www.baidu.com">
<img src="">
</a>
span tag element
Used to group inline elements in a document. Generally, it operates on ordinary text
<span class="haha" style="color: blue; font-size: 30px;">
<p>哈哈哈哈2</p>
<p>哈哈哈哈2</p>
<p>哈哈哈哈2</p>
</span>
div tag element
Implement style changes to a piece of content element
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Lightly-HTML-Project</title>
<style>
.box1{
float: left;
}
.box2{
float: right;
}
</style>
</head>
<body>
<div class="box1">
<h1>sssss</h1>
<p>xixixi2</p>
</div>
<div class="box2">
<h3>dddd</h1>
<p>呵呵呵</p>
</div>
</body>
</html>