用html和css做信封(用htmlcss做奥运五环)

一、需要了解两个css属性

1. border-radius:画圆环,当值取50%时;

width:200px; height:200px;就会变成圆形

2.position:absolute; 绝对定位

就是可以将五个圆环进行位置设置的,比如上下、左右移动都可以。

二 、代码部分

<!DOCTYPE html> <html lang="en"> <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> .item{ width:200px; height:200px; border:10px solid; border-radius:50%; position:absolute; box-sizing:border-box; margin:auto; } .class1{ left:0; top:0; border-color:blue; z-index: 2; } .class2{ left:200px; top:0; border-color:#000; } .class3{ left:400px; top:0; border-color:red; z-index:2; } .class4{ left:100px; top:120px; border-color:yellow; } .class5{ left:300px; top:120px; border-color:green; } </style> </head> <body> <div class="item class1"></div> <div class="item class2"></div> <div class="item class3"></div> <div class="item class4"></div> <div class="item class5"></div> </body> </html>

三、效果

用html和css做信封(用htmlcss做奥运五环)(1)

,

免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com

    分享
    投诉
    首页