gpt4 book ai didi

html - CSS:无法将顶级属性设置为超过 100%

转载 作者:太空宇宙 更新时间:2023-11-04 01:18:32 25 4
gpt4 key购买 nike

我无法将顶级属性设置为超过 100%。下面是我的 CSS 代码:

引用规则集.blue3。 top 属性必须大于 100% 才能对齐元素。

.container {
display: flex;
justify-content: center;
}

.circle {
margin-top: 50px;
display: inline-block;
position: relative;
float: left;
}

.wrapper {
overflow: hidden;
border-radius: 50%;
}

.green, .green:before, .green:after, .blue, .blue:before, .blue:after, .blue1, .blue1:before, .blue1:after, .blue2, .blue2:before, .blue2:after, .blue3:before, .blue3:after {
width: 100px;
height: 100px;
border-radius: 50%;
}

.green, .blue, .blue1, .blue2, .blue3{
position: relative;
opacity: .5;
}

.green:before, .blue:before, .blue1:before, .blue2:before, .blue3:before {
top: -50%;
}

.green:after, .blue:after, .blue1:after, .blue2:after, .blue3:after {
bottom: -50%;
}

.green {
background-color: rgb(10,210,30);
}

.green:before, .green:after {
content: '';
background-color: #fff;
position: absolute;
left: -50%;
}

.blue {
position: absolute;
background-color: rgb(0,20,210);
left: 50%;
top: 17%;
}
.blue1 {
position: absolute;
background-color: rgb(0,20,210);
left: 50%;
top: 50%;
}

.blue2 {
position: absolute;
background-color: rgb(0,20,210);
left: 50%;
top: 83%;
}

.blue3 {
position: absolute;
background-color: rgb(0,20,210);
left: 50%;
bottom: 200%;
}


.blue:before, .blue:after, .blue1:after, .blue1:before, .blue2:before, .blue2:after, .blue3:before, .blue3:after {
content: '';
background-color: #fff;
position: absolute;
right: -50%;
}
<html>
<head>
<title>1st Main Task</title>
</head>
<body>
<section class="container">
<section class="circle">
<section class="wrapper">
<section class="green"></section>
<section class="blue"></section>
<section class="blue1"></section>
<section class="blue2"></section>
<section class="blue3"></section>
</section>
<section class="wrapper">
<section class="green"></section>
</section>
<section class="wrapper">
<section class="green"></section>
</section>
<section class="wrapper">
<section class="green"></section>
</section>
</section>
<section class="circle">
<section class="wrapper">
<section class="green"></section>
<section class="blue"></section>
<section class="blue1"></section>
<section class="blue2"></section>
<section class="blue3"></section>
</section>
<section class="wrapper">
<section class="green"></section>
</section>
<section class="wrapper">
<section class="green"></section>
</section>
<section class="wrapper">
<section class="green"></section>
</section>
</section>
<section class="circle">
<section class="wrapper">
<section class="green"></section>
<section class="blue"></section>
<section class="blue1"></section>
<section class="blue2"></section>
<section class="blue3"></section>
</section>
<section class="wrapper">
<section class="green"></section>
</section>
<section class="wrapper">
<section class="green"></section>
</section>
<section class="wrapper">
<section class="green"></section>
</section>
</section>
<section class="circle">
<section class="wrapper">
<section class="green"></section>
<section class="blue"></section>
<section class="blue1"></section>
<section class="blue2"></section>
<section class="blue3"></section>
</section>
<section class="wrapper">
<section class="green"></section>
</section>
<section class="wrapper">
<section class="green"></section>
</section>
<section class="wrapper">
<section class="green"></section>
</section>
</section>
<section class="circle">
<section class="wrapper">
<section class="green"></section>
<section class="blue"></section>
<section class="blue1"></section>
<section class="blue2"></section>
<section class="blue3"></section>
</section>
<section class="wrapper">
<section class="green"></section>
</section>
<section class="wrapper">
<section class="green"></section>
</section>
<section class="wrapper">
<section class="green"></section>
</section>
</section>
</section>
</body>
</html>

最佳答案

.green, .green:before, .green:after, .blue, .blue:before, .blue:after, .blue1, .blue1:before, .blue1:after, .blue2, .blue2:before, .blue2:after, .blue3, .blue3:before, .blue3:after {
width: 100px;
height: 100px;
border-radius: 50%;
}

我猜 .blue3 在 css 中丢失了

关于html - CSS:无法将顶级属性设置为超过 100%,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49613871/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com