当前位置:网站首页>padding百分比操作
padding百分比操作
2022-06-26 17:23:00 【丹丹的小跟班】
在css里面padding值也是可以设置百分比的
- 1.如果 position 属性为 static 、 relative 或 sticky,包含块就是该元素最近的祖先块级元素的 content 决定
- 2.如果 position 属性为 absolute、fixed,包含块还要额外算上 padding,即 content + padding。
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
<style> body {
width: 1000px; height: 500px; padding: 100px; } .out {
position: relative; width: 200px; height: 100px; padding: 10%; } .inner {
position: absolute; width: 100px; height: 50px; padding: 10%; } </style>
</head>
<body>
<div class="out">
<div class="inner">inner</div>
</div>
</body>
</html>

边栏推荐
- Inspirational. In one year, from Xiaobai to entering the core Department of Alibaba, his counter attack
- Jouer avec Linux et installer et configurer MySQL facilement
- Demonstrate to Xiaobai the case of sub database and sub table
- Use FST JSON to automatically generate faster JSON serialization methods
- Halcon's region: features of multiple regions (5)
- Sandboxed container: container or virtual machine
- Platform management background and merchant menu resource management: merchant registration management design
- 在国金证券开户怎么样?保障安全吗?
- Preparing for the Blue Bridge Cup and ccf-csp
- Prometeus 2.34.0 new features
猜你喜欢

Redis OM . Net redis object mapping framework

Play with Linux and easily install and configure MySQL

防火 疏散 自救…这场安全生产暨消防培训干货满满!

Microservice architecture practice: user login and account switching design, order query design of the mall

Necessary decorator mode for 3 years' work

9、智慧交通项目(2)

MySQL index

Decentralized NFT transaction protocol will defeat opensea

Rich professional product lines, and Jiangling Ford Lingrui · Jijing version is listed

Teach you to learn dapr - 3 Run the first with dapr Net program
随机推荐
[C language] static modifies local variables
Discussion: the next generation of stable coins
Redis' 43 serial cannons, try how many you can carry
Alibaba's "high concurrency" tutorial "basic + actual combat + source code + interview + Architecture" is a god class
背包问题求方案数
MySQL index
How sparksql returns a specific day of the week by date -dayofweek function
Army chat -- registration of Registration Center
Introduction to minimal API
Jouer avec Linux et installer et configurer MySQL facilement
When I was in the library, I thought of the yuan sharing mode
The king of Internet of things protocol: mqtt
Prometeus 2.34.0 new features
Play with Linux and easily install and configure MySQL
【推荐系统学习】推荐系统的技术栈
[dynamic planning] Jianzhi offer II 091 Paint the house
Deployment and operation of mongodb partitioned cluster
关于FlowUs这一款国民好笔记
20: Chapter 3: develop the pass service: 3: get through the redis server in the program; (it only connects with the redis server and does not involve specific business development)
Leetcode 1169. Query invalid transactions (if the amount of data is small, this problem still needs to be solved by violent enumeration)