The content of this article is about the analysis of commonly used tags in HTML (with code). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
1.1 Classification of tags
1.1.1 Classification by subject:
1. Tags with subject : Such as data
2. Label without subject: such as
Line break label
Determine whether a table needs to be Subject, you can think about whether the tag needs to encapsulate data. If it needs to encapsulate data, then the tag must have a body. If it does not need to encapsulate data, then there is no need to have a body .
2.1.2 Classification by line :
1. If the content of a label needs to occupy an independent line, we call it a block label. For example:
2. If a tag does not need to occupy a separate line, we call it an inline tag. For example: Font tag
2.2 Text tag:
#Tag name | Tag description | Common attributes |
Title tag, | All titles are bold , 1 means level 1 heading, the largest word size, level 6 heading is the smallest | Attribute is inside the start tag align:Set title alignment center: center, right: right-aligned, left: left-aligned
|
Draw a horizontal line | width: Line length size: Thickness color: Color | |
b | Bold the font, which has the same function as the strong tag||
i | Set the font to italic||
br | Line break
| |
Font (obsolete in HTML5) | color: color size: size face: the name of the specified font | |
Paragraph, each p tag is a paragraph, there is no first line indentation. There are gaps between paragraphs | If you want to indent, use half-width space can also be full-width space title:When the mouse is moved up, text prompt information will be displayed |
特殊的字符 | 对应的实体字符 |
< | < |
> | > |
空格 | |
¥ |
¥ |
© 版本所有 | © |
® | ® |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style type="text/css"></style> <script type="text/javascript"></script> </head> <body> <h1>标签是标题标签<br/> 百度(纳斯达克:BIDU),全球最大的中文搜索引擎、最大的中文网站。 1999年底,身在美国硅谷的李彦宏看到了中国互联网及中文搜索引擎服务的巨大发展潜力, 抱着技术改变世界的梦想,他毅然辞掉硅谷的高薪工作,携搜索引擎专利技术,于 2000年1月1日在中关村创建了百度公司。<br/> 青岛啤酒:¥16元一瓶。<br/> 《java从入门到放弃》:© XXX版权所有<br/> 本次活动解释权归XXX公司所有:®XXX有限公司 </body> </html>
2.6 图像标签(img)
2.6.1 标签的作用:
在网页中显示图片。
2.6.2 常用的属性:
属性名 | 作用 |
src | source图片文件地址,注:不能使用客户端本地地址,如:c:/aaa.jpg |
width | 图片宽度,如果只指定宽和高,另一个参数会等比例缩放 |
height | 图片高度 |
alt | 如果图片丢失,图片显示的文字 |
title | 如果鼠标移到图片上,显示提示文字信息 |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style type="text/css"></style> <script type="text/javascript"></script> </head> <body> <img src="img/11.jpg" height="500" width="200" title="这个是一辆豪车" /> </body> </html>
相关推荐:
The above is the detailed content of Analysis of commonly used tags in html (with code). For more information, please follow other related articles on the PHP Chinese website!