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

边栏推荐
- 物联网协议的王者:MQTT
- 【uniapp】uniapp手机端使用uni.navigateBack失效问题解决
- Jouer avec Linux et installer et configurer MySQL facilement
- 分布式缓存/缓存集群简介
- Over the weekend: 20000 words! Summary of JVM core knowledge, 18 serial cannons as a gift
- Getting started with mongodb
- mysql Add column 失败 因为之前有数据,不是默认null 不行
- Teach you to learn dapr - 9 Observability
- Concurrent thread safety
- QPushButton 样式使用示例(以及按钮setmenu添加下拉菜单的方法)
猜你喜欢

Jouer avec Linux et installer et configurer MySQL facilement

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

Daily record 2

Necessary decorator mode for 3 years' work

防火 疏散 自救…这场安全生产暨消防培训干货满满!
![[C language] static modifies local variables](/img/bf/9084d2e924c3e1e244568562a83d74.jpg)
[C language] static modifies local variables

Alibaba's "high concurrency" tutorial "basic + actual combat + source code + interview + Architecture" is a god class

9、智慧交通项目(2)

Community ownership of NFT trading market is unstoppable

Microservice architecture practice: user login and account switching design, order query design of the mall
随机推荐
Leetcode 1170. Frequency of occurrence of the minimum letter of the comparison string (yes, solved)
丰富专业化产品线, 江铃福特领睿·极境版上市
接水面试题
Teach you to learn dapr - 4 Service invocation
链游系统开发技术方案设计丨NFT链游系统开发流程及源码
Some explanations for latex CJK
The difference between round and truncate in SQL (round or truncate)
[buuctf.reverse] 126-130
10 cloud security best practices that enterprises need to know
Introduction to minimal API
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)
The latest masterpiece of Alibaba, which took 182 days to produce 1015 pages of distributed full stack manual, is so delicious
Wechat app mall, review products, upload commodity pictures, and score Commodity Services
Alibaba's "high concurrency" tutorial "basic + actual combat + source code + interview + Architecture" is a god class
Various types of gypsum PBR multi-channel mapping materials, please collect them quickly!
Fire evacuation and self rescue... This safety production and fire training is full!
Viewing the task arrangement ability of monorepo tool from turborepo
sparksql如何通过日期返回具体周几-dayofweek函数
QPushButton 样式使用示例(以及按钮setmenu添加下拉菜单的方法)
Incomplete line spacing adjustment of formula display in word