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

代码如下:
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的更多相关文章
- 用纯css画个三角形
用纯css画个三角形以下是源代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " ...
- 纯css画三角形
纯css画三角形与border元素相关 设置border的属性 width: 100px; height: 100px; border-style: solid; border-width: 100p ...
- CSS之纯CSS画的基本图形(矩形、圆形、三角形、多边形、爱心、八卦等)
图形包括基本的矩形.圆形.椭圆.三角形.多边形,也包括稍微复杂一点的爱心.钻石.阴阳八卦等.当然有一些需要用到CSS3的属性,所以在你打开这篇文章的时候,我希望你用的是firefox或者chrome, ...
- 【原创】纯CSS画黄金梅丽号!
代码如下 <!DOCTYPE html> <!-- saved from url=(0055)http://jadyoap.bj.bcebos.com/ife%2FcssCatAni ...
- 纯CSS画的基本图形
图形包括基本的矩形.圆形.椭圆.三角形.多边形,也包括稍微复杂一点的爱心.钻石.阴阳八卦等.当然有一些需要用到CSS3的属性,所以在你打开这篇文章的时候,我希望你用的是firefox或者chrome, ...
- 用纯CSS画大白
纯CSS打造网页大白知识点: 首先要把大白分割,整体baymax中包含header(eye1,eye2,mouth),torso(heart),belly(cover),l-bigfinge ...
- 理解纯CSS画三角形
pure css draw a triangle code { display: inline-block; width: 300px; background-color: #E0E0E0 } .te ...
- 8.17 纯css画一个着重号图标
今天看到一个同事写的着重号图标,我以为是图片,仔细一看,是span标签!哇!!学习一下哈哈 图标长这样: CSS代码: .hint{ display: inline-block; width: 20p ...
- 纯css 画气泡
我们知道运用css可以绘画出各式各样的形状:三角形,圆形,正方形,椭圆形,平行四边形等等,而通过他们之间进行两两组合可以变换出各种意想不到的效果图,气泡框就是其中一个.最简单的气泡框就是一个矩形框+一 ...
随机推荐
- DB proxy, mysql proxy
db proxy 在大型互联网站的数据库部署中,部署最多的数据库为MySQL.随着MySQL中Innodb存储引擎对事物的支持,MySQL在互联网公司部署中,应用量越来越多.典型应用MySQL的公司有 ...
- EMQ 与 mqtt 与 IOT设备
1.IOT设备的特性 IOT(物联网things of internet)设备和传统的智能设备有什么区别,笔者总结下的IOT设备有如下特点: 硬件能力差(存储能力基本只有几MB,CPU频率低连使用HT ...
- 网络公开课和MOOC资源
美国(USA) 1. 麻省理工学院开放课程(Free Online Course Materials/ MIT OpenCourseWare) 2. 耶鲁大学开放课程(Online Video Lec ...
- java String 转Json报错 java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntim
这个问题就是缺少jar包依赖!!! java.lang.NoClassDefFoundError: org/apache/commons/beanutils/DynaBean 缺少commons-be ...
- date命令时间戳和时间之间的转换
这里是在mac下的操作,主要就是用date这个命令,更多的用法用man命令查看 字符串格式时间 TO 时间戳我们知道date 命令可以直接把当前时间转化为时间戳 # date +%s143678152 ...
- openresty开发系列38--通过Lua+Redis 实现动态封禁IP
openresty开发系列38--通过Lua+Redis 实现动态封禁IP 一)需求背景为了封禁某些爬虫或者恶意用户对服务器的请求,我们需要建立一个动态的 IP 黑名单.对于黑名单之内的 IP ,拒绝 ...
- [LeetCode] 256. Paint House 粉刷房子
There are a row of n houses, each house can be painted with one of the three colors: red, blue or gr ...
- [LeetCode] 516. Longest Palindromic Subsequence 最长回文子序列
Given a string s, find the longest palindromic subsequence's length in s. You may assume that the ma ...
- mysql查询之部门工资最高的员工
最近发现一个网站 力扣 查看 上面有很多算法和数据库的题目,做了一下,发现自己平时都疏忽了,因此边做边记录下来 Employee 表包含所有员工信息,每个员工有其对应的 Id, salary 和 de ...
- Java 8 集合之流式(Streams)操作, Streams API 详解
因为当时公司的业务需要对集合进行各种各样的业务逻辑操作,为了提高性能,就用到了这个东西,因为以往我们以前用集合都是需要去遍历(串行),所以效率和性能都不是特别的好,而Streams就可以使用并行的方式 ...