html css 奥运五环,用css写一个有趣的奥运五环~。

用css实现奥运五环样式,并且于页面居中显示,不随页面滚动条而移动,一直处于居中位置。

html代码部分就一个div里边包含5个div。代码如下:

Document

div.main{

position: fixed;

left: 50%;

top: 50%;

margin-left: -190px;

margin-top: -95px;

}

div.cir1{

width: 100px;

height: 100px;

border:10px solid #00f;

border-radius: 50%;

z-index: 1;

position: relative;

}

div.cir2{

width: 100px;

height: 100px;

border: 10px solid #ff0;

border-radius: 50%;

z-index: 2;

position: absolute;

left: 60px;

top: 50px;

}

div.cir3{

width: 100px;

height: 100px;

border: 10px solid #000;

border-radius: 50%;

z-index: 1;

position: absolute;

left: 130px;

top: 0px;

}

div.cir4{

width: 100px;

height: 100px;

border: 10px solid #0f4;

border-radius: 50%;

z-index: 1;

position: absolute;

left:200px;

top:50px;

}

div.cir5{

width: 100px;

height: 100px;

border: 10px solid #f00;

border-radius: 50%;

z-index: 2;

position: absolute;

left: 260px;

top: 0px;

}

效果图:

f139d60e70b5f9fdc9103190253cbf60.png

本文地址:https://blog.csdn.net/loringray/article/details/85947668

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值