我们都知道太阳系是以太阳为中心的,和所有受到太阳的引力约束天体的集合体。包括八大行星(由离太阳从近到远的顺序:水星、金星、地球、火星、木星、土星、天王星、海王星),而我用html和css所写的就是八大行星和太阳组成的星系,比较简易,代码如下:

* {

padding: 0;

margin: 0;

}

body {

width: 100%;

height: 100%;

background-color: #9370DB;

}

ul {

height: 600px;

width: 600px;

margin: 50px auto;

list-style: none;

/* background: red; */

}

ul li {

/* 在页面的中间呈现 */

position: absolute;

top: 50%;

left: 50%;

transform: translate(-50%,-50%);

border: 2px solid #D3D3D3;

}

/* 最中间圆的设置--太阳 */

li:nth-child(1) {

width: 60px;

height: 60px;

border-radius: 50%;

/* 设置阴影 */

box-shadow: 0 0 50px #FAFF27;

background-color: #FAFF27;

}

/* 设置第二个轨道线 */

li:nth-child(2) {

width: 120px;

height: 120px;

border-radius: 50%;

/* animation简写:名称 时间 速度(下面设置的速度从头到尾相同) 播放次数(此为无限) */

animation: rotate 30s linear infinite;

}

/* 水星设置 */

li:nth-child(2) span {

width: 15px;

height: 15px;

border-radius: 50%;

background-color: deepskyblue;

position: absolute;

top: 0;

left: 25px;

}

li:nth-child(3) {

width: 180px;

height: 180px;

border-radius: 50%;

animation: rotate 20s linear infinite;

}

/* 金星 */

li:nth-child(3) span {

width: 20px;

height: 20px;

border-radius: 50%;

background-color: gold;

position: absolute;

top: 0;

left: 35px;

}

li:nth-child(4) {

width: 240px;

height: 240px;

border-radius: 50%;

animation: rotate 20s linear infinite;

}

/* 地球 */

li:nth-child(4) > span {

width: 25px;

height: 25px;

border-radius: 50%;

background-color: #6dff39;

position: absolute;

top: 0;

left: 135px;

animation: rotate 10s linear infinite;

}

/* 月亮 */

li:nth-child(4) > span span {

width: 10px;

height: 10px;

border-radius: 50%;

background-color: #ff40c0;

position: absolute;

top: 0;

left: 30px;

}

li:nth-child(5) {

width: 300px;

height: 300px;

border-radius: 50%;

animation: rotate 10s linear infinite;

}

/* 火星 */

li:nth-child(5) span {

width: 18px;

height: 18px;

border-radius: 50%;

background-color: red;

position: absolute;

top: 0;

left: 90px;

}

li:nth-child(6) {

width: 360px;

height: 360px;

border-radius: 50%;

animation: rotate 30s linear infinite;

}

/* 木 */

li:nth-child(6) span {

width: 24px;

height: 24px;

border-radius: 50%;

background-color: burlywood;

position: absolute;

top: 0;

left: 100px;

}

li:nth-child(7) {

width: 420px;

height: 420px;

border-radius: 50%;

animation: rotate 40s linear infinite;

}

/* 土 */

li:nth-child(7) > span {

width: 25px;

height: 25px;

border-radius: 50%;

background-color: brown;

position: absolute;

top: 0;

left: 190px;

animation: rotate 15s linear infinite;

}

li:nth-child(8) {

width: 480px;

height: 480px;

border-radius: 50%;

animation: rotate 10s linear infinite;

}

/* 天王 */

li:nth-child(8) span {

width: 15px;

height: 15px;

border-radius: 50%;

background-color: #3f8042;

position: absolute;

top: 0;

left: 175px;

}

li:nth-child(9) {

width: 540px;

height: 540px;

border-radius: 50%;

animation: rotate 20s linear infinite;

}

li:nth-child(9) span {

width: 30px;

height: 30px;

border-radius: 50%;

background-color: #0000FF;

position: absolute;

top: 0;

left: 175px;

}

/* 关键帧 */

@keyframes rotate {

0% {

transform: translate(-50%,-50%) rotate(0deg);

}

100% {

transform: translate(-50%,-50%) rotate(360deg);

}

}

html css怎么做太阳,Html+css编写太阳星系相关推荐

  1. CSS基础(emmet 语法,CSS 复合选择器, 布局认知,背景样式)

    CSS基础 1. emmet 语法 -- 开发效率 1.1 emmet 语法生成 html 标签 emmet 的特点和作用是什么? 通过简写提高编码效率. emmet 生成 HTML 结构语法 序号 ...

  2. html通过分辨率动态加载css,做响应式页面,响应式和自适应的区别

    html通过分辨率动态加载css,做响应式页面 响应式和自适应的区别: 自适应需要写多个页面,响应式只需一个页面即可 自适应通过窗口检测,获取不同的页面:响应式通过窗口检测,在客户端做不同的处理 法1 ...

  3. [css] 让网页的字体变得清晰,变细用CSS怎么做?

    [css] 让网页的字体变得清晰,变细用CSS怎么做? 全家桶:-webkit-font-smoothing: antialiased -moz-osx-font-smoothing: graysca ...

  4. [css] 如何做图片预览,如何放大一个图片?

    [css] 如何做图片预览,如何放大一个图片? 图片不跨域的话用 canvas 来 drawImage 放大裁剪也可以. 个人简介 我是歌谣,欢迎和大家一起交流前后端知识.放弃很容易, 但坚持一定很酷 ...

  5. [css] 除了可以用js跟踪用户信息外,如果不用js,使用纯css怎么做呢?

    [css] 除了可以用js跟踪用户信息外,如果不用js,使用纯css怎么做呢? 可以利用 css 的伪类 :hover :active :focus 之类的监听用户行为,然后给指定的url 发送请求. ...

  6. 运用HTML5+CSS3和CSS滤镜做的精美的登录界面

    原始出处http://chenjinfei.blog.51cto.com/2965201/774865 <!DOCTYPE HTML> <html> <head> ...

  7. 用HTML+CSS简单做了张简历表格

    这里写自定义目录标题 用HTML+CSS简单做了张简历表格 效果图: 代码块: 用HTML+CSS简单做了张简历表格 效果图: 代码块: <!DOCTYPE html> <html& ...

  8. CSS 如何做一个比较真实有感觉的阴影效果

    CSS 如何做一个比较真实有感觉的阴影效果 效果如图: 阴影:你需要了解的: box-shadow 这个样式可以同时添加多个阴影,以 , 间隔即可 本例中的阴影有两个,一个向左偏移一个向右偏移 box ...

  9. html与css编程证书,利用CSS布局做一个简单的荣誉证书(代码示例)

    本篇文章将给大家介绍如何使用css布局制作一个简单的荣誉证书,有趣且实用,希望对需要的朋友有所帮助! 那么利用css布局实现简单荣誉证书样式的效果是非常简单的,主要用到以下几个基础属性: backgr ...

最新文章

  1. 512块A100,AlphaFold训练时间从11天压缩至67小时
  2. ListView 异步更新出现问题的解决(Handler)
  3. [转载]hadoop集群默认配置和常用配置
  4. PHP-SESSION深入理解
  5. pythonapi是什么意思_python api是什么
  6. 02全志r58平台Android4.4.4下关闭内核中的CPU的开启关闭提示
  7. vmware-tools安装
  8. 如何用sbt新建akka项目
  9. python和数据库_python与数据库操作
  10. hive常见的建表方式有哪些?各自的使用场景是?
  11. 【HDOJ】1261 字串数【组合数学--排列+代数】
  12. MySQL--mysqldump的权限说明
  13. onPageScroll微信小程序底部悬浮框滑到底部隐藏,其他情况显示
  14. C++ Windows键盘钩子
  15. ildasm、ilasm修改、反编译 已经编译的 dll文件(c#)
  16. UE4安装教程,虚幻引擎安装教程,UE4的安装
  17. 网络图的绘制方法详细讲解
  18. 通过淘宝数据学习爬虫,python scrapy requests与response对象
  19. Python入门(四):Python变量
  20. dbpedia知识图谱java_一种基于DBpedia的水务领域概念知识图谱构建方法与流程

热门文章

  1. java arraycopy方法_Java System.arrayCopy()方法
  2. 被黑出翔的“韭菜收割机”,GTC徐乐的区块链创业招黑史
  3. 以太坊智能合约是什么?
  4. tx2在自制载板上无法识别usb以及pcie无法读取数据
  5. 高效会议:明确会议主题,紧紧围绕不偏题
  6. 东农计算机调剂,2019年东北农业大学农业机械化工程专业考研调剂信息
  7. javase跟javaee的介绍
  8. HDU 5172 GTY's gay friends (线段树)
  9. 规模较小,速度更快的网站
  10. Find–atime –ctime –mtime的用法与区别总结