个性化阅读
专注于IT技术分析

HTML的构建块

本文概述

HTML文档包含以下基本构建块:

  • 标签:HTML标签围绕内容并对其应用含义。它写在<和>括号之间。
  • 属性:HTML中的属性提供有关元素的额外信息, 并将其应用在开始标记中。 HTML属性包含两个字段:名称和值。

句法

<tag name  attribute_name= " attr_value"> content </ tag name>
  • 元素:HTML元素是HTML文件的单个组件。在HTML文件中, 标记内编写的所有内容均称为HTML元素。
HTML构建块

<!DOCTYPE html>
<html>
  <head>
	<title>The basic building blocks of HTML</title>
 </head>
  <body>
       <h2>The building blocks</h2>
       <p>This is a paragraph tag</p>
       <p style="color: red">The style is attribute of paragraph tag</p>
       <span>The element contains tag, attribute and content</span>
  </body>
</html>

立即测试

输出:




  
	The basic building blocks of HTML
 
  
       The building blocks
       This is a paragraph tag
       The style is attribute of paragraph tag
       The element contains tag, attribute and content
  
	
赞(0)
未经允许不得转载:srcmini » HTML的构建块

评论 抢沙发

评论前必须登录!