当前位置:网站首页>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>

边栏推荐
- MySql 导出数据库中的全部表索引
- What does the equals method compare? Who told you
- Microservice architecture practice: user login and account switching design, order query design of the mall
- How sparksql returns a specific day of the week by date -dayofweek function
- Fire evacuation and self rescue... This safety production and fire training is full!
- Leetcode - 226. Retourner l'arbre binaire (bfs)
- vue--vuerouter缓存路由组件
- 宝藏又小众的CTA动画素材素材网站分享
- 分布式架构概述
- The difference between round and truncate in SQL (round or truncate)
猜你喜欢

Preparing for the Blue Bridge Cup and ccf-csp

Cache breakdown! Don't even know how to write code???

Redis OM . Net redis object mapping framework

Deployment and operation of mongodb partitioned cluster

14 MySQL tutorial insert insert data

SQL injection for Web Security (3)

MySQL index

Platform management background and merchant menu resource management: Design of platform management background data service

MySql 导出数据库中的全部表索引

Treasure and niche CTA animation material website sharing
随机推荐
Platform management background and merchant menu resource management: merchant registration management design
vue--vuerouter缓存路由组件
Sandboxed container: container or virtual machine
接水面试题
Alibaba's "high concurrency" tutorial "basic + actual combat + source code + interview + Architecture" is a god class
sql中ROUND和TRUNCATE的区别(四舍五入还是截取小数点后几位)
js强制转换
分布式架构概述
在国金证券开户怎么样?保障安全吗?
【代码随想录-动态规划】T583、两个字符串的删除操作
MySQL add column failed because there was data before, not null by default
Leetcode - 226. Retourner l'arbre binaire (bfs)
Environment setup mongodb
Cloud native 02: Alibaba cloud cloud efficient flow pipeline
Preparing for the Blue Bridge Cup and ccf-csp
Wechat app mall, review products, upload commodity pictures, and score Commodity Services
背包问题求方案数
Problems encountered this week
Incomplete line spacing adjustment of formula display in word
Teach you to learn dapr - 3 Run the first with dapr Net program