搜索
首页web前端html教程HTML 图例标签

HTML 图例标签

Sep 04, 2024 pm 04:21 PM
htmlhtml5HTML TutorialHTML PropertiesHTML tags

图例标签用于定义的标题或标题。标签,并且它被认为是该元素的第一个子元素。作为标题,它通常放置在框架的顶部。 的目的是是在特定元素的内容上创建一个包围框。主要目的是借助字段集包装表单、图像、内容,也用于描述信息的上下文。在下面的部分中,我们将讨论有关的信息。标签以及深入的示例。本文的主要座右铭是展示如何简单且创造性地使用 HTML 元素标签进行演示。

语法

<legend>
……
</legend>

HTML

;元素被放置在 内元素,其周围标记为黑色边框;如果你想要一个时尚的或改变框架的行为,那么这里使用CSS。这个标签与
完全不同。标签。此标签支持所有浏览器,如 Chrome、android、firefox、Opera、Internet Explorer。所有这些元素在所有浏览器中都是统一的。

代码:


Text … Content

必须提供开始和结束标签。

属性

一般来说,HTML 标签具有一个或多个属性,这些属性提供了 HTML 元素的重要方面。图例标签支持所有已定义的全局属性。某些属性不支持现代网络浏览器。下表给出了标签属性及其描述。

1.标签特定属性

align:定义表单中给定的标题或说明文字相对于父级

的对齐方式。

代码:


Align demo:

注意:为了清晰对齐,最好对元素的变体使用 CSS-Align。

2.标准属性

这些属性的描述已经在上一篇文章中讨论过。

  • 访问密钥
  • 班级
  • 目录
  • id
  • 风格
  • id
  • 标签索引
  • 标题

3.全局属性

图例标签还接受之前讨论的全局属性,这是所有 HTML5 元素的标准。下面列出了一些:

Context

Define the Context

Dir

 The values give the path of the text.

Id

 Its identifier must match the value of a name.

Style

 Specifies the inline and external styles.

Lang

Determines the language used in the text.

上下文

onabort It is called when a particular event has been aborted. For example, the web browser immediately video before it is completely downloaded.
onblur Defines the focus of the element.
oncancel Stops the processed event handler.
Onclick Triggers when a click is done
onchange When a click is done somewhere.
onfocus Triggered when the focus is on the given element
定义上下文

目录

这些值给出了文本的路径。

Id

其标识符必须与名称值匹配。

样式

 指定内联样式和外部样式。

确定文本中使用的语言。

表> 4.事件属性

5. Other Attributes Are

onmouse down, onmouse up, onmouse over, onmouse move, onmouse out, on focus, on blur, onkey press,onkey down,onkey up. The tags that come with the tag are listed below:


  • HTML 图例标签
  • <script></script>

Examples to Implement Area Tag in HTML

Below are the examples of implementing the area tag in HTML:

Example #1

This section focuses on the form and fieldset. Association of legend tags with the fieldset and preferring to use with the forms gives the best option.

Code:



Personal Information: FirstName: 
LastName: 
Email:
Age:

Output:

HTML 图例标签

Example #2

The below examples show how the fieldset element groups the labels and radio buttons and checklist together. Meanwhile, the legend tag should be given for the caption for the group. A similar approach can be implemented with other controls.

Code:



Tutorial

Output:

HTML 图例标签

Example #3

In the following example, we group the information under the HTML tag

. And each control has been declared under the element as the first child to it.

Code:



<title>HTML Test with buttons</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


Selection options list Checkbox:
RadioButton1:
RadioButton2:
Input Text Login Id:
Password:
Employee Designation

Software Engineer

Data Analyst

Web Developer

Senior Analyst

Output:

HTML 图例标签

Example #4

Using Align Attributes Demo. Align attributes has three values

  • align= “center”,
  • align= “right”
  • align= “left”

Code:



Align demo: City:
State:

Output:

HTML 图例标签

Example #5

Using CSS- Style. Using CSS, the Legend caption/Title colour is changed by declaring a color attribute to various colors.

Code:



<title>Legend Tag Implementation</title>
<style>
form{
width: 45%;
}
legend {
display: block;
padding-left: 12px;
padding-right: 12px;
border: 2px solid pink;
background-color:green;
color:white;;
}
label {
display: inline-block;
float: left;
clear: left;
width: 91px;
margin:4px;
text-align: center;
}
input[type="text"] {
width:250px;
margin:4.5px 0px;
}
.cba {
font-size:35px;
color:blue;
font-weight:500;
font-style :italic;
}
</style>


<div class="cba"> Research Organization</div>
<h2 id="Legend-tag">Legend tag</h2>
Employee:



Output:

HTML 图例标签

Conclusion – HTML Legend Tag

To conclude, we have seen how the legend tag has been used as a caption for a group element. The use of this article benefits the HTML components. Also, the legend improves good accessibility when the fieldset is null. It is considered to be the best design-related group tag in HTML5. These tags are very useful in web development with proper CSS code with proper design techniques.

以上是HTML 图例标签的详细内容。更多信息请关注PHP中文网其他相关文章!

声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
如何验证您的HTML代码?如何验证您的HTML代码?Apr 24, 2025 am 12:04 AM

HTML代码可以通过在线验证器、集成工具和自动化流程来确保其清洁度。1)使用W3CMarkupValidationService在线验证HTML代码。2)在VisualStudioCode中安装并配置HTMLHint扩展进行实时验证。3)利用HTMLTidy在构建流程中自动验证和清理HTML文件。

HTML与CSS和JavaScript:比较Web技术HTML与CSS和JavaScript:比较Web技术Apr 23, 2025 am 12:05 AM

HTML、CSS和JavaScript是构建现代网页的核心技术:1.HTML定义网页结构,2.CSS负责网页外观,3.JavaScript提供网页动态和交互性,它们共同作用,打造出用户体验良好的网站。

HTML作为标记语言:其功能和目的HTML作为标记语言:其功能和目的Apr 22, 2025 am 12:02 AM

HTML的功能是定义网页的结构和内容,其目的在于提供一种标准化的方式来展示信息。1)HTML通过标签和属性组织网页的各个部分,如标题和段落。2)它支持内容与表现分离,提升维护效率。3)HTML具有可扩展性,允许自定义标签增强SEO。

HTML,CSS和JavaScript的未来:网络开发趋势HTML,CSS和JavaScript的未来:网络开发趋势Apr 19, 2025 am 12:02 AM

HTML的未来趋势是语义化和Web组件,CSS的未来趋势是CSS-in-JS和CSSHoudini,JavaScript的未来趋势是WebAssembly和Serverless。1.HTML的语义化提高可访问性和SEO效果,Web组件提升开发效率但需注意浏览器兼容性。2.CSS-in-JS增强样式管理灵活性但可能增大文件体积,CSSHoudini允许直接操作CSS渲染。3.WebAssembly优化浏览器应用性能但学习曲线陡,Serverless简化开发但需优化冷启动问题。

HTML:结构,CSS:样式,JavaScript:行为HTML:结构,CSS:样式,JavaScript:行为Apr 18, 2025 am 12:09 AM

HTML、CSS和JavaScript在Web开发中的作用分别是:1.HTML定义网页结构,2.CSS控制网页样式,3.JavaScript添加动态行为。它们共同构建了现代网站的框架、美观和交互性。

HTML的未来:网络设计的发展和趋势HTML的未来:网络设计的发展和趋势Apr 17, 2025 am 12:12 AM

HTML的未来充满了无限可能。1)新功能和标准将包括更多的语义化标签和WebComponents的普及。2)网页设计趋势将继续向响应式和无障碍设计发展。3)性能优化将通过响应式图片加载和延迟加载技术提升用户体验。

HTML与CSS vs. JavaScript:比较概述HTML与CSS vs. JavaScript:比较概述Apr 16, 2025 am 12:04 AM

HTML、CSS和JavaScript在网页开发中的角色分别是:HTML负责内容结构,CSS负责样式,JavaScript负责动态行为。1.HTML通过标签定义网页结构和内容,确保语义化。2.CSS通过选择器和属性控制网页样式,使其美观易读。3.JavaScript通过脚本控制网页行为,实现动态和交互功能。

HTML:是编程语言还是其他?HTML:是编程语言还是其他?Apr 15, 2025 am 12:13 AM

HTMLISNOTAPROGRAMMENGUAGE; ITISAMARKUMARKUPLAGUAGE.1)htmlStructures andFormatSwebContentusingtags.2)itworkswithcsssforstylingandjavascript for Interactivity,增强WebevebDevelopment。

See all articles

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热工具

安全考试浏览器

安全考试浏览器

Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

Atom编辑器mac版下载

Atom编辑器mac版下载

最流行的的开源编辑器

适用于 Eclipse 的 SAP NetWeaver 服务器适配器

适用于 Eclipse 的 SAP NetWeaver 服务器适配器

将Eclipse与SAP NetWeaver应用服务器集成。

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

SecLists

SecLists

SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。