CSS February March

Source: Internet
Author: User

Yesterday is said to be an eclipse of XXX or something, so I learned about css3 and realized it.

The implementation principle is very simple. cover a small circle with a large circle. = ·:

Use a WebKit-based browser for testing. If you need other browsers, you can change the corresponding prefix (-WebKit,-Moz,-O)

Demo address: http://fronter.sinaapp.com/wp-content/demo/eclipse.html


Final effect:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css">
body{ background: #000;}
#earth{position: relative; margin-top: 200px; }
position: absolute; top:-90px; left: 50%; width: 180px; height: 180px; margin-left: -90px;
border-radius: 100px;
background: -webkit-gradient(linear, left bottom, right top, from(#BDA08D), to(#fff));
box-shadow: 0 0 30px #D4D4D4;
position: absolute;
border-radius: 0 0 0 90px;
position: absolute; top:850px; left: 400px; width: 300px; height: 300px; border-radius: 150px; background: #000;
position: relative; top:-1000px; width: 1000px; height: 1000px; margin: 0 auto; border-radius: 500px;
@-webkit-keyframes eclipse{
0%{-webkit-transform: rotate(-30deg);}
20%{-webkit-transform: rotate(-15deg);}
40%{-webkit-transform: rotate(0deg);}
60%{-webkit-transform: rotate(15deg);}
80%{-webkit-transform: rotate(30deg);}
100%{-webkit-transform: rotate(45deg);}
<div id="earth">
<div id="moon">

<div id="orbit">
<div id="dog"></div>
<script type="text/javascript">
var dog = document.getElementById('dog');



For more information, see http://www.cnblogs.com/xesam /]
Address: http://www.cnblogs.com/xesam/archive/2011/12/11/2283712.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.