当前位置:网站首页>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>
边栏推荐
- Interpretation of new plug-ins | how to enhance authentication capability with forward auth
- Army chat -- registration of Registration Center
- 玩轉Linux,輕松安裝配置MySQL
- COMP5216 Mobile Computing Assignment 1 - Extending ToDoList app
- What does the equals method compare? Who told you
- VSCode使用 - Remote-SSH 配置说明
- Romance of the Three Kingdoms: responsibility chain model
- Quantitative contract system development analysis case - detailed explanation of contract quantitative system development scheme
- Basic requirements: 7 problems in singleton mode
- Detailed contract quantification system development scheme and technical description of quantitative contract system development
猜你喜欢
The high concurrency system is easy to play, and Alibaba's new 100 million level concurrent design quick notes are really fragrant
Necessary decorator mode for 3 years' work
Redis and database data consistency
并发之线程安全
Getting started with mongodb
[C language] static modifies local variables
Which low code platform is more friendly to Xiaobai? Here comes the professional evaluation!
Can Luo Yonghao succeed in entering the AR field this time?
Turtle cartography
Daily record 2
随机推荐
Community ownership of NFT trading market is unstoppable
How about opening an account at Guojin securities? Is it safe?
Quantitative contract system development analysis case - detailed explanation of contract quantitative system development scheme
在国金证券开户怎么样?保障安全吗?
Army chat -- registration of Registration Center
Prometeus 2.34.0 新特性
Redis' 43 serial cannons, try how many you can carry
【推荐系统学习】推荐系统的技术栈
Some explanations for latex CJK
Today, I met a "migrant worker" who took out 38K from Tencent, which let me see the ceiling of the foundation
Introduction to distributed cache / cache cluster
[C language] static modifies local variables
玩轉Linux,輕松安裝配置MySQL
Wechat app mall, review products, upload commodity pictures, and score Commodity Services
【万字总结】以终为始,详细分析高考志愿该怎么填
并发之线程安全
Incomplete line spacing adjustment of formula display in word
halcon之区域:多种区域(Region)特征(5)
Getting started with mongodb
10 cloud security best practices that enterprises need to know