Detailed explanation of inline elements and block-level elements in commonly used HTML tags

Detailed explanation of inline elements and block-level elements in commonly used HTML tags

Block element HTML tag classification details

* address - address
* blockquote - block quote
* center - center alignment block
* dir - directory listing
* div - commonly used block level, also the main tag of css layout
* dl - definition list
* fieldset - form control group
* form - interactive form (can only be used to contain other block elements)
* h1 - Large title
* h2 - Subtitle
* h3 - Level 3 heading
* h4 - Level 4 heading
* h5 - Level 5 heading
* h6 - Level 6 heading
* hr - horizontal separator line
* isindex - input prompt
* menu - menu list
* noframes - frames optional content, (for browsers that do not support frames, this block content is displayed
* noscript - optional script content (displayed for browsers that do not support script)
* ol - sorting form
* p - paragraph
* pre - format text
* table - table
* ul - unordered list

Inline element HTML tag classification details

* a - anchor point
* abbr - abbreviation
* acronym - first letter
* b - bold (not recommended)
* bdo - bidi override
* big - large font
* br - line break
* cite - cite
* code - computer code (required when citing source code)
* dfn - defines the field
* em - emphasis
* font - font settings (not recommended)
* i - italic
* img - image
* input - input box
* kbd - defines keyboard text
* label - table label
*q - short quote
* s - hyphen (not recommended)
* samp - defines sample computer code
* select - item selection
* small - small font text
* span - commonly used inline container, defines the text block
* strike - a dash
* strong - bold emphasis
* sub - subscript
* sup - superscript
* textarea - multi-line text input box
* tt - Teletext
* u - underscore
* var - defines a variable

Variable elements HTML tag classification details

* applet - java applet
* button - buttons
* del - delete text
* iframe - inline frame
* ins - inserted text
* map - image block (map)
* object - object
* script - client script

Summarize:

1. Block-level elements such as div h1 p ul li will wrap and want to be displayed on the same line

Need to float or display: inline

2. Inline elements such as a span b can be displayed side by side. The default width setting does not work.

You need to set display: inline-block or block.

Summarize

The above is the editor's introduction to the inline elements and block-level elements in the commonly used HTML tags. I hope it will be helpful to everyone. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

<<:  Summary of important components of MySQL InnoDB

>>:  Implementing a simple whack-a-mole game in JavaScript

Recommend

HTML+css to create a simple progress bar

1. HTML code Copy code The code is as follows: Ex...

Summary of the differences between global objects in nodejs and browsers

In Node.js, a .js file is a complete scope (modul...

Introduction to general_log log knowledge points in MySQL

The following operation demonstrations are all ba...

MySQL Router implements MySQL read-write separation

Table of contents 1. Introduction 2. Configure My...

Detailed explanation of MySQL syntax, special symbols and regular expressions

Mysql commonly used display commands 1. Display t...

Writing a rock-paper-scissors game in JavaScript

This article shares the specific code for writing...

HTML tags list and usage instructions

List of HTML tags mark type Name or meaning effec...

WeChat applet scroll-view realizes left and right linkage

This article shares the specific code for WeChat ...

How to create Apache image using Dockerfile

Table of contents 1. Docker Image 2. Create an in...

The difference and choice between datetime and timestamp in MySQL

Table of contents 1 Difference 1.1 Space Occupanc...

Analysis of the difference between bold <b> and <strong>

All of us webmasters know that when optimizing a ...

MySQL InnoDB MRR Optimization Guide

Preface MRR is the abbreviation of Multi-Range Re...

Solve the problem of using linuxdeployqt to package Qt programs in Ubuntu

I wrote some Qt interface programs, but found it ...

Detailed tutorial on deploying Apollo custom environment with docker-compose

Table of contents What is the Apollo Configuratio...