static: Static positioning is the default value of position. The element box is generated normally, that is, it is displayed normally when there is no positioning.
relative: relative positioning
Usage 1: The element is offset by a certain distance relative to its original position, but the original space is still retained and appears as blank.
Usage 2: Set an element to position: relative; to make the child elements of the element absolutely positioned relative to the element.
Absolute: Absolutely positioned
The element is removed from the document flow and positioned relative to the containing block. The element is closed in its original space. A block-level box is generated after the element is positioned, regardless of whether it was originally an inline element or a block-level element.
Containing block: The nearest position value is not a static ancestor element (block level or inline). Generally, an element is designated as the containing block of the absolutely positioned element, and its position is set to relative without offset.
Fixed: Fixed positioning
The element is removed from the document flow and positioned relative to the browser window, so it does not move as the document scrolls. The element is closed in its original space. A block-level box is generated after the element is positioned, regardless of whether it was originally an inline element or a block-level element. The only difference from absolute positioning is the containing block.
Containing block: browser window.
Comparison between absolute/fixed and float
Similar: elements will be deleted from the document flow, but it will still affect the layout; a block-level box will be generated, regardless of whether it is a block-level element or not.
Difference: The containing block of float is the nearest block-level ancestor element.
Offset attribute: top/right/bottom/left, the initial value is auto.
After using position positioning, the offset attribute must be used to define the offset, which is the offset relative to the containing block. Note that it applies to elements whose position value is not static.
Sometimes it is also necessary to define width and height, but it may conflict with the definition of the offset attribute, because the four offset attributes actually define the size of the element. At this time, the left and right are defined according to the width and left attributes, and the top and bottom are defined according to the top and height attributes.
Content overflow overflow: visible/ hidden/ scroll /auto/ inherit, the initial value is visible.
The size of an element is fixed, but its content cannot fit, which will cause overflow. Overflow controls the visibility, invisible (hidden), and scroll visibility (scroll) of the overflow part.
Element visibility visibility: visible/ hidden/ collapse/ inherit, the initial value is visible.
The difference between visibility:hidden and display:none: visibility:hidden sets the element to be invisible, but the element will still affect the layout, but the element is partially rendered blank; display:none element is not displayed and is deleted from the document flow, which affects the document Layout has no effect.

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?

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

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

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

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

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

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

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


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

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

WebStorm Mac version
Useful JavaScript development tools

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

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download
The most popular open source editor