


div css absolute positioning and relative positioning
Many friends have asked me how to distinguish absolute from relative and how to use them ? We all know that absolute is absolute positioning and relative is relative positioning, but what do absolute and relative mean? What is the absolute, and relative is relative to what? So what characteristics do they have and what effects can they produce? What kind of skills are there between the two? Let’s explain them one by one below. Absolute, the writing method in CSS is: position:absolute; It means absolute positioning. It refers to the upper left corner of the browser and cooperates with TOP, RIGHT, BOTTOM, and LEFT (hereinafter referred to as TRBL) for positioning. When TRBL is not set, the default is based on the parent's original point for marking. If TRBL is set and the parent does not set the position attribute, then the current absolute will be positioned with the upper left corner of the browser as the original point, and the position will be determined by TRBL. Generally speaking, it is easy to make mistakes when using Absolute if the webpage is centered, because the webpage always automatically adapts to the size of the resolution, and Absolute will use the upper left corner of the browser as the The original point will not change position due to changes in resolution. This is where many people go wrong. The characteristics of the webpage on the left are very similar to Relative, but there are still essential differences. Relative, the writing method in CSS is: position:relative; It means relative positioning. It refers to the original point of the parent as the original point. If there is no parent, the previous element will be in the order of the text flow. The bottom is the original point, which is positioned with TRBL. When there are CSS attributes such as padding in the parent, the original point of the current level is positioned with reference to the original point of the parent content area. Sometimes we also need to rely on z-index to set the upper and lower relationship of the container. The larger the value, the higher it is at the top. The value range is a natural number. However, z-index is not omnipotent. Z-index is also subject to level restrictions. For information about this level restriction, please see "Unbreakable Levels" |

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.


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

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

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.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)