居中的五环
来源:互联网 发布:信用卡网络盗刷 编辑:程序博客网 时间:2024/04/29 20:57
1.做一个奥运五环,在页面里水平垂直居中,无论怎样拖拽页面,五环的相应位置都不变.(提示: border-radius: 50%为圆环 ,z-index : 10;(只在定位元素生效,设置环的相压顺序))
代码 五环.html
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Wuhuan</title> <link rel="stylesheet" href="FC.css"></head><body> <div class = "demo"> <div class = "demo1"></div> <div class = "demo2"></div> <div class = "demo3"></div> <div class = "demo4"></div> <div class = "demo5"></div> </div></body></html>
代码FC.css
*{ margin: 0 ; padding: 0 ;}.demo{ height: 180px; width: 380px; position:absolute; top: 50%; left: 50%; margin-top: -100px; margin-left: -200px; background-color: pink; /*为了更好地显示舞台的效果,所以背景置成pink*/}.demo1{ height : 100px; width : 100px; position: absolute; border: 10px solid blue; border-radius:50%;}.demo2{ height : 100px; width : 100px; position:absolute; left:130px; border :10px solid black; border-radius : 50%;}.demo3{ height : 100px; width : 100px; position: absolute; left : 260px; border : 10px solid red; border-radius : 50%;}.demo4{ height : 100px; width : 100px; position: absolute; left : 65px; top : 60px; border : 10px solid yellow; border-radius : 50%;}.demo5{ height : 100px; width : 100px; position: absolute; left : 195px; top : 60px; border : 10px solid green; border-radius : 50%;}
0 0
- 居中的五环
- 居中的五种方式
- 解决div中元素垂直居中的五种方法
- 用css的垂直居中五种方法
- div中的内容垂直居中的五种方法
- div中的内容垂直居中的五种方法
- div中的内容垂直居中的五种方法
- div中的内容垂直居中的五种方法
- 水平居中的五种方法及其优缺点
- div垂直水平居中的五种方法
- div中的内容垂直居中的五种方法
- div中的内容垂直居中的五种方法
- CSS实现垂直居中的五种方法
- 实现水平垂直居中的五种方法
- div中的内容-图片img垂直居中的五种方法
- 五种方法实现css垂直居中
- CSS学习笔记(五):居中显示
- div的上下居中,左右居中,左右上下都居中
- Java 与 C++ 的缠绵瓜葛(语言对比)
- php通过Apache搭建的服务器电脑端通过127.0.0.1可以访问,手机无法访问的问题
- HTML基础3
- ForEach Method in Java8
- 综合布线技术发展趋势
- 居中的五环
- HTML
- 首次安装AndroidStudio可能碰到的异常
- VS2015编译boost 1.62.0
- OKHTTP 特点及使用
- 网易云信直播聊天室:无上限人数&系统不卡顿,是不是鱼与熊掌不能兼得?
- 下拉菜单
- Win7下VirtualBox虚拟机安装Ubuntu手册
- 网络攻击技术(二)——Cross-site scripting