search
HomeWeb Front-endCSS Tutorial10 recommended articles about length units

When dealing with mobile pages, we sometimes need to make the banner image into a square with the same width as the screen to obtain the best experience, such as Flipbord’s mobile page: So how should we use pure CSS to make an adaptive banner? What about the size of the square? Solution 1: CSS3 vw unit CSS3 adds a new set of length units vw, vh, vmin, vmax relative to the percentage of the visible area. where vw is the unit relative to the percentage of the viewport width, 1vw = 1% viewport width, vh is the unit relative to the percentage of the viewport height, 1vh = 1% viewport height; vmin is the smaller one relative to the current viewport width and height. Percentage unit, similarly vmax is the percentage unit that is larger than the current viewport width and height. The browser compatibility of this unit is as follows: Using the vw unit, we can easily make adaptive squares:

&a

##1. Detailed introduction about mobile pages

10 recommended articles about length units

#Introduction: When dealing with mobile pages, we sometimes It may be necessary to make the banner image into a square with the same width as the screen to obtain the best experience, such as Flipbord's mobile page: So how to use pure CSS to create a square that can adapt to the size? Solution 1: CSS3 vw unit CSS3 adds a new set of length units vw, vh, vmin, vmax relative to the percentage of the visible area. where vw is the unit relative to the percentage of the viewport width, 1vw = 1% viewport width...

2.

Recommended 10 articles about vw units

Introduction: When dealing with mobile pages, we sometimes need to make the banner image into a square with the same width as the screen to obtain the best experience, such as Flipbord’s mobile page: Then How to use pure CSS to create a square that can adapt to its size? Solution 1: CSS3 vw unit CSS3 adds a new set of length units vw, vh, vmin, vmax relative to the percentage of the visible area. where vw is the unit relative to the percentage of the viewport width, 1vw = 1% viewport width...

3.

Detailed introduction to the height attribute

10 recommended articles about length units

Introduction: CSS height refers to the corresponding p height set through CSS styles. The CSS height attribute is the word height, and the width width can be set to Calculate the height as a percentage, set the height as a pixel value, set the height in relative length units, and so on. This attribute is supported by all major browsers. The following will summarize the use of the height attribute. 1. Use CSS to solve the highly adaptive problem. I am very resistant to using js to solve the highly adaptive problem, because it is not easy to maintain and not natural enough. However, it is not easy to use pure CSS, such as the example I will talk about below. Requirements: 1. ...

4.

Summary of how to use the height attribute height in css

10 recommended articles about length units

Introduction: CSS height refers to the corresponding p height set through CSS styles. The CSS height attribute is the word height. The width width can be set to calculate the height as a percentage, set the height as a pixel value, Set height in relative length units and so on. This attribute is supported by all major browsers. The following is a summary of how to use the height attribute. 1. Use CSS to solve highly adaptive problems. I am very resistant to using js to solve highly adaptive problems, because it is difficult to maintain and not natural enough. However, using pure CSS is not easy, such as the example I will talk about below.

5.

Summary of how to use the width attribute width in css

10 recommended articles about length units

Introduction: CSS width refers to setting the corresponding div width through CSS style. The CSS width attribute is the word width. The width width can be set to calculate the width as a percentage, set the width as a pixel value, or set the width as a relative length unit. etc. This attribute is supported by all major browsers.

6.

Summary of the three common length units in css (px em rem)

10 recommended articles about length units

#Introduction: The following is a summary of the common html units in web pages, and an introduction to length units in css+div layout. Personally, I think that the disadvantage of using px as the font unit and not being able to use the browser font scaling function under IE is no longer that important. Because the new versions of IE7 and IE8 already support the zoom function of the entire web page, including Firefox, which zooms the entire web page by default instead of scaling CSS fonts. Is there any significance in not simply scaling the font size?

7. css margin margin properties and usage summary

10 recommended articles about length units

##Introduction: The white space surrounding the border of an element is the margin. Setting margins creates additional "white space" outside the element. The simplest way to set margins is to use the margin property. The margin property accepts any length unit, which can be pixels, inches, millimeters or ems, percentage values ​​or even negative values. This article will talk about the margin property and how to use it in detail.

8. Detailed explanation of the use of CSS margin attributes

10 recommended articles about length units

##Introduction: The simplest way to set margins is to use the margin attribute. The margin property accepts any length unit, which can be pixels, inches, millimeters, or ems. margin can be set to auto. A more common approach is to set a length value for the margins. The following declaration sets 1/4-inch margin on all sides of the h1 element:

9.

Details of length units in CSS

10 recommended articles about length units

Introduction: The following editor will bring you an old cliché about the length unit in CSS. The editor thinks it is quite good, so I will share it with you now and give it as a reference. Let’s follow the editor and take a look

10.

php uses mb_substr() to solve the problem of Chinese string interception and garbled characters

10 recommended articles about length units

Introduction: PHP comes with several string interception functions, among which substr and mb_substr are commonly used. When the former processes Chinese, GBK is 2 length units and UTF is 3 length units. After the latter specifies encoding, one Chinese character is 1 length unit.

The above is the detailed content of 10 recommended articles about length units. 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
A Little Reminder That Pseudo Elements are Children, Kinda.A Little Reminder That Pseudo Elements are Children, Kinda.Apr 19, 2025 am 11:39 AM

Here's a container with some child elements:

Menus with 'Dynamic Hit Areas'Menus with 'Dynamic Hit Areas'Apr 19, 2025 am 11:37 AM

Flyout menus! The second you need to implement a menu that uses a hover event to display more menu items, you're in tricky territory. For one, they should

Improving Video Accessibility with WebVTTImproving Video Accessibility with WebVTTApr 19, 2025 am 11:27 AM

"The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect."- Tim Berners-Lee

Weekly Platform News: CSS ::marker pseudo-element, pre-rendering web components, adding Webmention to your siteWeekly Platform News: CSS ::marker pseudo-element, pre-rendering web components, adding Webmention to your siteApr 19, 2025 am 11:25 AM

In this week's roundup: datepickers are giving keyboard users headaches, a new web component compiler that helps fight FOUC, we finally get our hands on styling list item markers, and four steps to getting webmentions on your site.

Making width and flexible items play nice togetherMaking width and flexible items play nice togetherApr 19, 2025 am 11:23 AM

The short answer: flex-shrink and flex-basis are probably what you’re lookin’ for.

Position Sticky and Table HeadersPosition Sticky and Table HeadersApr 19, 2025 am 11:21 AM

You can't position: sticky; a

Weekly Platform News: HTML Inspection in Search Console, Global Scope of Scripts, Babel env Adds defaults QueryWeekly Platform News: HTML Inspection in Search Console, Global Scope of Scripts, Babel env Adds defaults QueryApr 19, 2025 am 11:18 AM

In this week's look around the world of web platform news, Google Search Console makes it easier to view crawled markup, we learn that custom properties

IndieWeb and WebmentionsIndieWeb and WebmentionsApr 19, 2025 am 11:16 AM

The IndieWeb is a thing! They've got a conference coming up and everything. The New Yorker is even writing about it:

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 Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool