search
HomeWeb Front-endCSS TutorialWhat is the definition of css block-level elements? What are the css block-level elements?

What are css block-level elements? For some friends who have just learned CSS, they may not understand this issue well. So, in this article, I will introduce to you the definition of css block-level elements, and what are the css block-level elements?

The definition of css block-level elements

According to the explanation on W3C, block (block-level) elements are displayed on an exclusive line. Its sibling elements must not be on the same line as it (unless out of the document flow). In fact, in layman's terms, block elements are generally container elements for other elements and can accommodate other block elements or inline elements. The most common ones are P and div. To put it simply, the block element is like a four-square box that can hold other four squares and can be presented anywhere on the page.

If you still don’t understand the above definition of CSS block-level elements, let’s take a look at the three characteristics of CSS block-level elements:

1. Each block-level element is unique If it occupies one line, the following elements can only start on another line, and two elements cannot share the same line.

2. The height, width, line height and top and bottom margins of the element can be set.

3. If the width of the element is not set, it defaults to the width of the parent element.

After reading the characteristics of these three css block-level elements, we should now have a better understanding of css elements. Then let’s take a look at what are the css block-level elements?

What are the block-level elements in css?

Common css block-level elements:

address: address.
blockquote: block quote.
center: Center alignment block.
dir: Directory list.
div: Commonly used block level is also the main tag of CSS layout.
dl: definition list.
fieldset: form control group.
form: interactive form.
h1–h6: Title.
hr: horizontal dividing line.
isindex: input prompt.
menu: menu list.
noframes: frames optional content, (this block content is displayed for browsers that do not support frames).
noscript: Optional script content (displayed for browsers that do not support script).
ol: Ordered form.
p: Paragraph.
pre: Formatted text.
table: table.
ul: Unordered list.

The introduction to css block-level elements ends here. The next article will introduce you to What are the css inline elements? The difference between css block-level elements and inline elements.

Related recommendations:

What are inline elements and block-level elements? _html/css_WEB-ITnose

Introduction to CSS block-level elements/inline elements, inheritance and related properties

The above is the detailed content of What is the definition of css block-level elements? What are the css block-level elements?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How much specificity do @rules have, like @keyframes and @media?How much specificity do @rules have, like @keyframes and @media?Apr 18, 2025 am 11:34 AM

I got this question the other day. My first thought is: weird question! Specificity is about selectors, and at-rules are not selectors, so... irrelevant?

Can you nest @media and @support queries?Can you nest @media and @support queries?Apr 18, 2025 am 11:32 AM

Yes, you can, and it doesn't really matter in what order. A CSS preprocessor is not required. It works in regular CSS.

Quick Gulp Cache BustingQuick Gulp Cache BustingApr 18, 2025 am 11:23 AM

You should for sure be setting far-out cache headers on your assets like CSS and JavaScript (and images and fonts and whatever else). That tells the browser

In Search of a Stack That Monitors the Quality and Complexity of CSSIn Search of a Stack That Monitors the Quality and Complexity of CSSApr 18, 2025 am 11:22 AM

Many developers write about how to maintain a CSS codebase, yet not a lot of them write about how they measure the quality of that codebase. Sure, we have

Datalist is for suggesting values without enforcing valuesDatalist is for suggesting values without enforcing valuesApr 18, 2025 am 11:08 AM

Have you ever had a form that needed to accept a short, arbitrary bit of text? Like a name or whatever. That's exactly what is for. There are lots of

Front Conference in ZürichFront Conference in ZürichApr 18, 2025 am 11:03 AM

I'm so excited to be heading to Zürich, Switzerland for Front Conference (Love that name and URL!). I've never been to Switzerland before, so I'm excited

Building a Full-Stack Serverless Application with Cloudflare WorkersBuilding a Full-Stack Serverless Application with Cloudflare WorkersApr 18, 2025 am 10:58 AM

One of my favorite developments in software development has been the advent of serverless. As a developer who has a tendency to get bogged down in the details

Creating Dynamic Routes in a Nuxt ApplicationCreating Dynamic Routes in a Nuxt ApplicationApr 18, 2025 am 10:53 AM

In this post, we’ll be using an ecommerce store demo I built and deployed to Netlify to show how we can make dynamic routes for incoming data. It’s a fairly

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

MantisBT

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

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools