【发布时间】:2021-11-09 17:04:41
【问题描述】:
这是我的带有样式的 HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<style>
html {
height: 100vh;
background-color: white;
display: flex;
justify-content: center;
align-items: center;
}
body {
position: absolute;
height: 70vh;
width: 70vh;
background-color: deeppink;
border-radius: 50%;
}
@media (orientation:landscape){
body{
height:70vw;
width:70vw;
}
}
</style>
<body></body>
</html>
我想要一个在左右两侧(移动设备)和上下(对于桌面设备)略微切割的圆圈,所以我认为这是最好的方法,但我观察到页面也以额外的宽度结束在移动设备和桌面设备上的额外高度,我不希望这种情况发生。
有什么办法可以解决这个问题,让圆圈保持切割状态并消除滚动?
【问题讨论】:
标签: html css flexbox css-position viewport