


What types of html tag elements are there? Introduction to common tag elements in html
The content of this article is to introduce the types of html tag elements, so that everyone can understand what are the commonly used tag elements in html? It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
First of all, let’s understand what types of html tag elements can be divided into?
Tag elements in HTML are generally divided into three different types: block elements, inline elements, and inline block elements.
Let’s introduce the characteristics and uses of these three types of elements in detail, and let everyone know what are the commonly used block elements and inline elements?
Block elements
Features:
1. Each block occupies one row The elements will start again from a new line and be arranged from top to bottom
2. You can directly control the width, height and related css properties of the box model (element's height, width, line height and top and bottom margins All can be set)
3. When the width is not set, the width of the block-level element is the width of the content of its parent element
4. When the height is not set, the width of the block-level element is the width of the content of the parent element. The height of a high-level element is the height of its own content. Because of its own characteristics, we usually use block elements to build large layouts (large structures).
Commonly used block elements:1. Ordinary elements
div (commonly used block containers and the main tags of CSS layout), p (Paragraph), hr (horizontal separator), table (table), form (interactive form)
2, title elements:
h1 (headline), h2 (subtitle), h3 (Third-level heading), h4 (fourth-level heading), h5 (fifth-level heading), h6 (sixth-level heading)
3, list element
menu (menu list), ol ( Ordered list), ul (unordered list), li (list item), dl (define list), dt (define term), dd (define description)
Let’s take a look at these blocks through simple code Shape element
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>块状元素</title> <style> div{ background-color: palegoldenrod; } p{ background-color:paleturquoise ; } h4{ background-color:papayawhip; } ul{ background-color: peru; } </style> </head> <body> <div>div标签元素,占据一行</div> <p>p标签元素,占据一行</p> <h4 id="标题元素-占据一行">标题元素,占据一行</h4> <ul> <li>ul1 li 标签 元素</li> <li>ul1 li 标签 元素</li> </ul> <ul> <li>ul2 li 标签 元素</li> <li>ul2 li 标签 元素</li> </ul> </body> </html>
Rendering:
Features:
1. Displayed in one line with other inline elements from left to right
2. Width, height and related css attributes of the box model cannot be directly controlled. However, it is possible to directly set the left and right values of the inner and outer margins 3. The width and height of inline elements are determined by the size of their own content (text, pictures, etc.) 4. Inline elements It can only accommodate text or other inline elements (please note here, do not nest block-level elements in inline elements)Because of its own characteristics, we usually use inline elements to carry text , Construction of small icons (small structures).Commonly used inline elements:
1. Common element tags
span (commonly used inline containers, defining in-text blocks), a ( Anchor point, link), img (introducing an image), br (forced line break), sub (subscript), sup (superscript) 2. Text modification tag b (add bold), strong (bold emphasis), i (italic), em (italic emphasis), big (large font text), small (small font text), s (underline (not recommended)), strike ( (underline), del (text that has been deleted in the document), u (underline) 3. Label elements used in the form textarea (multi-line text input box), input (Input box), select (drop-down list), label input (element definition label (mark))<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>行内元素</title> <style> span{ background-color: palegoldenrod; } p{ background-color:paleturquoise ; } </style> </head> <body> <span>span标签元素1</span> <span>span标签元素2</span> <img src="/static/imghwm/default1.png" data-src="1.png" class="lazy" style="max-width:90%" / alt="What types of html tag elements are there? Introduction to common tag elements in html" > <img src="/static/imghwm/default1.png" data-src="1.png" class="lazy" style="max-width:90%" / alt="What types of html tag elements are there? Introduction to common tag elements in html" > <p>换一行看看文字效果,我是一段测试代码,<b>被b标签加粗</b>。我是一段测试代码,<i>被i标签变成斜体</i>。</p> </html>Rendering:
Features:
1. They are on the same line as other elements and will not wrap automatically. The default arrangement is from left to right; 2. The height, width, line height, top and bottom margins of the element can be set. Inline block elements combine the characteristics of inline elements and block elements, but each has its own trade-offs. Therefore, inline block elements are used more often due to their characteristics in daily use, and are useful in many aspects.Summary: The above are the three types of html tag elements introduced in this article, namely: block elements, inline elements, inline block elements; and an introduction to commonly used block elements and inline elements. Each type of label has its own characteristics. You can try it yourself to see how different labels are used, deepen your understanding, and use different labels in different situations as needed. I hope it will be helpful to everyone's learning. For more related tutorials, please visit: HTML video tutorial, Html5 video tutorial, bootstrap video tutorial!
The above is the detailed content of What types of html tag elements are there? Introduction to common tag elements in html. For more information, please follow other related articles on the PHP Chinese website!

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The role of HTML is to define the structure and content of a web page through tags and attributes. 1. HTML organizes content through tags such as , making it easy to read and understand. 2. Use semantic tags such as, etc. to enhance accessibility and SEO. 3. Optimizing HTML code can improve web page loading speed and user experience.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

WebStorm Mac version
Useful JavaScript development tools