好几天没有更新了,直接上效果吧,哈哈!(我想这个应该大部分都会!哈哈哈!)

代码如下:

html:

<div class="container">
<div class="round"></div>
<div class="longround"></div>
<div class="screen">iphone 7plus</div>
<div class="home"></div>
</div>

css:

<style type="text/css">
.container {
width: 300px;
height: 600px;
background-color: rgba(0, 0, 0, .6);
margin: 50px auto;
border-radius: 30px;
box-shadow: 0 0 20px rgba(0, 0, 0, .5);
position: relative;
z-index:;
}
.container::before {
content: "";
width: 3px;
height: 50px;
background: rgba(0, 0, 0, .5);
position: absolute;
top: 170px;
left: 300px;
border-radius: 0 4px 4px 0;
}
.container::after {
content: "";
width: 3px;
height: 100px;
background: rgba(0, 0, 0, .5);
position: absolute;
top: 50px;
left: 300px;
border-radius: 0 4px 4px 0;
}
.container .round {
width: 12px;
height: 12px;
border: 3px solid #4a4a4a;
background-color: rgba(0, 0, 0, .6);
border-radius: 50%;
position: absolute;
left: 50%;
top: 10px;
margin-left: -7.5px;
}
.container .longround {
position: absolute;
width: 100px;
height: 8px;
border: 3px solid #4a4a4a;
background-color: rgba(0, 0, 0, .6);
border-radius: 30px;
position: absolute;
left: 50%;
margin-left: -50px;
top: 35px;
}
.container .screen {
width: 280px;
height: 470px;
background: linear-gradient(to bottom, rgba(255, 255, 255, .2), rgba(255, 255, 255, .8));
position: absolute;
top: 60px;
left: 50%;
margin-left: -140px;
color: #fff;
text-align: center;
font-weight: bold;
font-size: 20px;
line-height: 450px;
box-shadow: 0 0 10px rgba(0, 0, 0, .6) inset;
}
.container .screen::before {
content: "";
width: 50px;
height: 4px;
background: rgba(0, 0, 0, .5);
border-radius: 3px 3px 0 0;
position: absolute;
top: -63px;
left: 180px;
}
.container .screen::after {
content: "";
width: 7px;
height: 10px;
background: rgba(0, 0, 0, .5);
border-radius: 5px 0 0 5px;
position: absolute;
top: -10px;
left: -17px;
}
.container .home {
width: 50px;
height: 50px;
border-radius: 50%;
background-color: rgba(0, 0, 0, .6);
border: 2px solid #4a4a4a;
position: absolute;
bottom: 10px;
left: 50%;
margin-left: -25px;
box-shadow: 0 0 2px black inset;
}
.container .home::before {
content: "";
width: 25px;
height: 25px;
background-color: transparent;
border: 2px solid rgba(255, 255, 255, .5);
position: absolute;
left: 10px;
top: 10px;
}
</style>

大家一起努力吧!!

纯 CSS 画 iphone的更多相关文章

  1. 用纯css画个三角形

    用纯css画个三角形以下是源代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " ...

  2. 纯css画三角形

    纯css画三角形与border元素相关 设置border的属性 width: 100px; height: 100px; border-style: solid; border-width: 100p ...

  3. CSS之纯CSS画的基本图形(矩形、圆形、三角形、多边形、爱心、八卦等)

    图形包括基本的矩形.圆形.椭圆.三角形.多边形,也包括稍微复杂一点的爱心.钻石.阴阳八卦等.当然有一些需要用到CSS3的属性,所以在你打开这篇文章的时候,我希望你用的是firefox或者chrome, ...

  4. 【原创】纯CSS画黄金梅丽号!

    代码如下 <!DOCTYPE html> <!-- saved from url=(0055)http://jadyoap.bj.bcebos.com/ife%2FcssCatAni ...

  5. 纯CSS画的基本图形

    图形包括基本的矩形.圆形.椭圆.三角形.多边形,也包括稍微复杂一点的爱心.钻石.阴阳八卦等.当然有一些需要用到CSS3的属性,所以在你打开这篇文章的时候,我希望你用的是firefox或者chrome, ...

  6. 用纯CSS画大白

    纯CSS打造网页大白知识点:      首先要把大白分割,整体baymax中包含header(eye1,eye2,mouth),torso(heart),belly(cover),l-bigfinge ...

  7. 理解纯CSS画三角形

    pure css draw a triangle code { display: inline-block; width: 300px; background-color: #E0E0E0 } .te ...

  8. 8.17 纯css画一个着重号图标

    今天看到一个同事写的着重号图标,我以为是图片,仔细一看,是span标签!哇!!学习一下哈哈 图标长这样: CSS代码: .hint{ display: inline-block; width: 20p ...

  9. 纯css 画气泡

    我们知道运用css可以绘画出各式各样的形状:三角形,圆形,正方形,椭圆形,平行四边形等等,而通过他们之间进行两两组合可以变换出各种意想不到的效果图,气泡框就是其中一个.最简单的气泡框就是一个矩形框+一 ...

随机推荐

  1. thread 线程分析工具

    (1) https://fastthread.io/ 将线程 jstack pid 出来之后,压缩一下成为zip 然后 上传上去

  2. [Beta]第十次 Scrum Meeting

    [Beta]第十次 Scrum Meeting 写在前面 会议时间 会议时长 会议地点 2019/5/20 22:00 20min 大运村公寓6F寝室 附Github仓库:WEDO 例会照片 工作情况 ...

  3. java如何实现批量删除pdf指定的页数

    依赖: <dependency> <groupId>org.apache.pdfbox</groupId> <artifactId>pdfbox-app ...

  4. java excel给单元格增加批注(包含SXSSF)

    package javatest; import java.io.FileOutputStream; import java.io.IOException; import org.apache.poi ...

  5. Xamarin图表开发基础教程(4)OxyPlot框架

    Xamarin图表开发基础教程(4)OxyPlot框架 XamaminAndroid中绘制线图OxyPlotAndroidDemo [示例1-1:OxyPlotAndroidDemo]下面实现线图的绘 ...

  6. 《精通CSS第3版》(6)内容布局(定位+水平布局)

  7. Sublime用正则表达式进行逗号分隔实现列的替换

    eg: ([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*).* 这是取前面10列,后面的不管 ...

  8. LeetCode_414. Third Maximum Number

    414. Third Maximum Number Easy Given a non-empty array of integers, return the third maximum number ...

  9. [LeetCode] 122. Best Time to Buy and Sell Stock II 买卖股票的最佳时间 II

    Say you have an array for which the ith element is the price of a given stock on day i. Design an al ...

  10. PCL贪婪投影三角化算法

    贪婪投影三角化算法是一种对原始点云进行快速三角化的算法,该算法假设曲面光滑,点云密度变化均匀,不能在三角化的同时对曲面进行平滑和孔洞修复. 方法: (1)将三维点通过法线投影到某一平面 (2)对投影得 ...