首页 > 其他分享 >HTML 07 - Headings

HTML 07 - Headings

时间:2024-05-13 21:09:23浏览次数:15  
标签:07 tags hierarchy Heading content HTML Headings heading

HTML headings are used to define the hierarchy (levels) and structure of content on a web page. They create a visual hierarchy, with the highest level heading which is h1 indicating the most important content or the main heading, and lower-level headings like h2, h3, h4, etc. for subtopics.

Reason to use Headings

Headings are crucial for structuring content and providing a clear visual indication of the beginning of new sections or topics. Properly structured headings enhance readability and user experience on websites, ensuring that information is organized and easy to navigate.

  • Heading impact on SEO: A well organized headings helps search engines to undestand the content structure and indexing.
  • Highlighting Important Topics: Using header tags properly keeps the content readable.
 

Examples of HTML Heading

In these examples we will see the usage of all the header tags to create a heading and will use CSS to convert a normal text into a heading.

Heading using h1-h6 tags

In this example we will use the heading tags (h1 to h6), each one of them has different size and weight for the content.

 
<!DOCTYPE html>
<html>
<body>
   <h1>This is heading 1</h1>
   <h2>This is heading 2</h2>
   <h3>This is heading 3</h3>
   <h4>This is heading 4</h4>
   <h5>This is heading 5</h5>
   <h5>This is heading 6</h5>
</body>
</html>  

 


Heading using CSS properties

In this example we will use CSS font-size and font-weight property to make a headeing element from a paragraph element.

 
<!DOCTYPE html>
<html>
<head>
    <style>
    p{
        font-size: 24px;
        font-weight: bold;
    }
    </style>
</head>
<body>
    <p>Tutorialspoint</p>
    <p>Simply Easy Learning</p>
</body>

</html>

 


HTML Heading Tags

HTML Heading is created by using using <h1> to <h6> tags. The heading hierarchy determines the importance of content and aids in creating a clear information flow for both users and search engines.

Hierarchical Structure of Heading Tags

Below is the list according to the hierarchy of the heading tags (most to least significant).

  • HTML <h1> Tag: The top-level heading denotes the main topic or title of the entire page.

  • HTML <h2> Tag: Subheadings under <h1> represent major sections related to the main topic. They provide a more specific context to the content.

  • HTML <h3> to <h6> Tags: These tags are used for further subsections or nested content within <h2> headings. They offer a deeper level of hierarchy for organizing content within specific sections.

Mistakes to be avoided

Make sure we avoid the following mistakes while using the heading tag:

  • Skipping Levels: Always follow the proper hierarchy (h1, h2, h3, etc.). Don't skip levels.

  • Overusing h1: Reserve h1 for the main title; don't use it multiple times on a page.

  • Styling Overload: Avoid excessive styling; CSS should handle the aesthetics, not headings.

 

 

标签:07,tags,hierarchy,Heading,content,HTML,Headings,heading
From: https://www.cnblogs.com/emanlee/p/18190006

相关文章

  • HTML 05 - Attributes
    HTML05-AttributesWehaveseenfewHTMLtagsandtheirusagelikeheadingtags<h1>,<h2>,paragraphtag<p>andothertags.Weusedthemsofarintheirsimplestform,butmostoftheHTMLtagscanalsohaveattributes,whichareext......
  • HTML 04 - Elements
    HTMLElementsarebuildingblockofawebpage.Itisusedtocreatecomponentforwebpages.HTMLdocumentsconsistofatreeoftheseelementsandtheyspecifyhowHTMLdocumentsshouldbebuilt,andwhatkindofcontentshouldbeplacedwithinvariousp......
  • HTML 03 - Basic Tags
    HTML-BasicTags HTMLtagsarethefundamentalelementsofHTMLusedfordefiningthestructureofthedocument.Thesearelettersorwordsenclosedbyanglebrackets(<and>).Usually,mostoftheHTMLtagscontainsanOpeningandaClosingtag......
  • HTML 02 - Editors
    HTML-EditorsTolearnHTMLwewillrecommendyoutouseatexteditorlikeNotepad,becauseaNotepadwillhelpyoutounderstandtherequirementofeachtag,itwillnotsuggestanythingonitsownthatwillbehelpfultounderstandtheHTMLsyntax. ......
  • HTML Tutorial
     HTMLstandsforHyperTextMarkupLanguage,itisaStandardMarkuplanguageforwebpages.HTMLisusedtocreatecontentandstructureofanywebpage.IfyouthinkofthehumanbodyasawebpagethenHTMListheskeletonofthebody.Itisthebuildi......
  • HTML5 参考手册(字母排序)
    标签描述<!--...-->定义注释<!DOCTYPE>定义文档类型<a>定义超文本链接<abbr>定义缩写<acronym>定义只取首字母的缩写,不支持HTML5<address>定义文档作者或拥有者的联系信息<applet>HTML5中不赞成使用。定义嵌入的applet。<area>定义图像映......
  • CodePen 的国内替代「笔.COOL」,一个功能完备、使用便捷的在线HTML代码编辑和作品分享
    笔.COOL,是一个在线HTML代码编辑和作品分享平台。笔.COOL提供了一个在线的HTML、CSS和JavaScript代码编辑器。无需任何安装,你只需打开网站,就可以开始编写前端代码。编辑器支持代码高亮、自动补全等功能,提高编码效率。笔.COOL还提供了实时预览功能,预览界面会随着你的代码更......
  • 代码随想录算法训练营第第二天 | 24. 两两交换链表中的节点 、19.删除链表的倒数第N
    两两交换链表中的节点用虚拟头结点,这样会方便很多。本题链表操作就比较复杂了,建议大家先看视频,视频里我讲解了注意事项,为什么需要temp保存临时节点。题目链接/文章讲解/视频讲解:https://programmercarl.com/0024.两两交换链表中的节点.html/***Definitionforsingly-li......
  • 071、洛阳女儿行
    071、洛阳女儿行唐●王维洛阳女儿对门居,才可颜容十五余。良人玉勒乘骢马,侍女金盘脍鲤鱼。画阁珠楼尽相望,红桃绿柳垂檐向。罗帏送上七香车,宝扇迎归九华帐。狂夫富贵在青春,意气骄奢剧季伦。自怜碧玉亲教舞,不惜珊瑚持与人。春窗曙灭九微火,九微片片飞花璅。戏罢曾无理曲时,妆......
  • html5新标签 画布 canvas 替代了 flash
    绘制矩形边框,和填充不同的是绘制使用的是strokeRect,和strokeStyle实现的 绘制路径绘制路径的作用是为了设置一个不规则的多边形状态路径都是闭合的,使用路径进行绘制的时候需要既定的步骤:需要设置路径的起点使用绘制命令画出路径封闭路径填充或者绘制已经封闭路......