Home > Article > Web Front-end > HTML basics
This article mainly introduces the basics of getting started with HTML. Interested friends can refer to it. I hope it will be helpful to everyone.
Tags, tags, elements
Tags and elements usually describe the same thing, but strictly speaking, an HTML element contains tags and closing tags.
A standard HTML page
<!DOCTYPE html> <!--声明了文档类型--> <html> <!--描述了文档类型--> <head> <!--可以插入<script>脚本,样式文件(css)以及各种meta信息 <meta http-equiv="content-type" content="text/html;charset="utf-8" /> <title>页面标题</title> </head> <body> <!--可视化网页内容(文档的主体)</body>
Common tags
①HTML title:
The title is defined through the
##②HTML paragraph:
The paragraph is defined by the tag, p is the abbreviation of "paragraph" and is often used to create a paragraph.
The link is defined by the tag . The a tag is also called an archor (anchor) element, which can be used to link to an external address to implement the page jump function, or to link to the internal navigation function of the current page. Href = "URL navigation" target = "_ Self": Jump on the current page (default) target = "_lank": New page jump ##hang anchor point: A token on a line in a document that links to a location in the document. If you only write it will return to the top of the page by default
④HTML image图像通过单标签来定义。 src指“source”。源属性的值是图像的URL地址。 alt属性用来为图像定义一串预备的可替换的文本。 title属性可以让鼠标悬停在图像上时显示title内容(通常是图像标题)。 ⑤特殊字符与标签
标签可以进行换行操作
标签可以定义水平线 空格 fd06c3119f051595c58245bd537d8431 >
⑥HTML文本格式化
可以使用标签与对输出的文本进行粗体或斜体转换。通常可以使用和代替前者。然而,这些标签的含义不同:
与定义粗体或斜体文本。
与意味着这段文本是重要的,所以要突出显示。
缩小文本 放大文本
下标 上标
保留文本里所有的空格和换行操作
对于HTML,无法通过在HTML代码中添加额外的空格和空行,所有连续的空格(换行)会被合并为一个。
⑦HTML区块
HTML可以通过
和将元素组合起来。大多数HTML元素被定义为块级元素或内联元素(行内元素)。
块级元素:独占一行,元素前后自动换行。例如: 、 、
The above is the detailed content of HTML basics. For more information, please follow other related articles on the PHP Chinese website!