加个小方块html,五环.html · sean/css写的跳动小方块 - Gitee.com

Document

* {

margin: 0px;

padding: 0px;

}

ul{

list-style: none;

display: flex;

position: relative;

}

li{

height:12em ;

width: 12em;

position: absolute;

z-index: 10;

}

li::after{

content: "";

height: 100%;

width: 100%;

border: red 20px solid;

display: block;

border-radius: 50%;

box-sizing: border-box;

}

li.blue{

top:0em;

left:0em;

}

li.blue::after{

border-color: blue;

}

li.blue.new{

z-index: 30;

}

li.blue.new::after{

border-color: blue blue transparent blue;

}

li.yellow{

top:5.7em;

left:6.8em;

}

li.yellow::after{

border-color: yellow;

}

li.yellow.new{

z-index: 25;

}

li.yellow.new::after{

border-color:yellow transparent yellow yellow ;

}

li.black{

top:0em;

left:13.6em;

}

li.black::after{

border-color: black;

}

li.green{

top:5.7em;

left:20.4em;

z-index: 9;

}

li.green::after{

border-color: green ;

}

li.green.new{

z-index: 15;

}

li.green.new::after{

border-color: transparent green green green;

}

li.red{

top:0em;

left:27.2em;

z-index: 11;

}

li.red::after{

border-color: red;

}

li.red.new::after{

border-color:red red transparent red ;

}

一键复制

编辑

Web IDE

原始数据

按行查看

历史

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,我可以为您演示如何使用HTML5和CSS创建奥运五环的简单示例。首先,我们可以使用HTML5创建五个圆形的 `div` 元素,并为每个元素添加一个唯一的类名,以便后续的CSS样式定义。例如: ```html <div class="circle blue"></div> <div class="circle yellow"></div> <div class="circle black"></div> <div class="circle green"></div> <div class="circle red"></div> ``` 然后,我们可以使用CSS样式定义这些圆形的外观以及它们之间的位置关系。例如: ```css .circle { width: 100px; height: 100px; border-radius: 50%; position: absolute; } .blue { background-color: blue; top: 0; left: 0; } .yellow { background-color: yellow; top: 0; left: 110px; } .black { background-color: black; top: 50px; left: 55px; } .green { background-color: green; top: 50px; left: 165px; } .red { background-color: red; top: 100px; left: 55px; } ``` 这些CSS样式将每个圆形定义为一个具有圆形形状、宽度和高度为100像素的 `div` 元素,并使用 `border-radius` 属性将其边框设置为圆形。每个圆形都被绝对定位,使它们可以在页面上正确地定位。 最后,我们可以在HTML文档中添加一个容器 `div` 元素,并将五个圆形元素包含在其中: ```html <div class="container"> <div class="circle blue"></div> <div class="circle yellow"></div> <div class="circle black"></div> <div class="circle green"></div> <div class="circle red"></div> </div> ``` 这将创建一个包含五个不同颜色的圆形的容器,它们按照奥运五环的标准排列。 希望这个简单的示例能帮助您了解如何使用HTML5和CSS创建奥运五环
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值