By manipulating different selectors and properties, you can make interesting shapes. One of the easier ones to try is a crescent moon shape.

For this challenge you need to work with the box-shadow property that sets the shadow of an element, along with the border-radius property that controls the roundness of the element's corners.

You will create a round, transparent object with a crisp shadow that is slightly offset to the side - the shadow is actually going to be the moon shape you see.

In order to create a round object, the border-radius property should be set to a value of 50%.

You may recall from an earlier challenge that the box-shadow property takes values for offset-xoffset-yblur-radiusspread-radius and a color value in that order. The blur-radius and spread-radius values are optional.

原始代码下的图形如下:

练习题:

Manipulate the square element in the editor to create the moon shape.

First, change the background-color to transparent, then set the border-radius property to 50% to make the circular shape.

Finally, change the box-shadow property to set the offset-x to 25px, the offset-y to 10px, blur-radius to 0, spread-radius to 0, and color to blue.

  • 先把蓝色的背景调成透明
  • 再调整后面绿色box-shadow阴影的边界半径,到50%
  • 最后是微调box-shadow,之前做过关于这个的练习,做过我都已经忘记了,所以自己调了下不同值的看了下效果。基本就是把新月的颜色从绿色改到蓝色,边缘模糊的变锐化了,以后遇到再细看吧

练习代码:

<style>
.center {
position: absolute;
margin: auto;
top: ;
right: ;
bottom: ;
left: ;
width: 100px;
height: 100px;
background-color: transparent;
border-radius: %;
box-shadow: 25px 10px blue;
} </style>
<div class="center"></div>

效果:

最新文章

  1. ajax的循环
  2. WebService 生成类的命令语句
  3. CentOS7 运行级别
  4. CodeBlocks配置pthread环境
  5. sql server 2008 安装过程与创建建sql server登录用户
  6. jquery中prop()方法和attr()方法的区别
  7. java异常处理机制Exception
  8. 转:cookie和session(二)——php应用
  9. LIS 最长单调子序列模板
  10. Apache常见功能实战详解
  11. java造成内存泄露原因
  12. Dynamics 365-CRM又报看不懂的错误了
  13. yarn安装
  14. windows通过node环境搭建安装npm,cnpm,vue-cli
  15. [LeetCode] 661. Image Smoother_Easy
  16. 使用Redis构建支持程序
  17. State of Serverless
  18. POSIX 消息队列 之 概述 链接方式
  19. JAVA特性-跨平台/面向对象
  20. 重学Veriliog(2)——高级编程语句

热门文章

  1. Nginx在开发中常用的基础命令
  2. git到GitHub的操作和遇到的一些问题
  3. linux部署.net Core项目
  4. python-基础-isinstance(p_object, class_or_type_or_tuple)
  5. IT兄弟连 HTML5教程 CSS3属性特效 3D变换3
  6. IT兄弟连 HTML5教程 CSS3属性特效 3D变换1
  7. tl-wr742n无线路由器怎么设置
  8. Key Management: Hardcoded Encryption key 密钥管理:硬编码加密密钥
  9. 使用 ASP.NET Core MVC 创建 Web API(六)
  10. Python 和 JS 有什么相似?