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

11 ways to remove duplicates from js arrays

In actual work or interviews, we often encounter ...

MySQL implements an example method of logging in without a password

Specific method: Step 1: Stop the mysql service /...

CentOS 7 installation and configuration tutorial under VMware10

If Ubuntu is the most popular Linux operating sys...

Solve the problem of inconsistency between mysql time and system time in docker

Recently, when I installed MySQL in Docker, I fou...

Linux touch command usage examples

Detailed explanation of linux touch command: 1. C...

What we can learn from Google's new UI (pictures and text)

The most significant website change in 2011 was Go...

How to set mysql permissions using phpmyadmin

Table of contents Step 1: Log in as root user. St...

Detailed explanation of vue.js dynamic components

:is dynamic component Use v-bind:is="compone...

Detailed tutorial on installing Docker and docker-compose suite on Windows

Table of contents Introduction Download and insta...

Vue recursively implements three-level menu

This article example shares the specific code of ...