zoukankan      html  css  js  c++  java
  • CSS制作华为mate8手机模型示例

     CSS制作华为mate8手机模型效果图

      1.HTML代码

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="UTF-8">
            <title></title>
        </head>
        <body>
            <div class="phone">
                <div class="body"></div>
                <div class="head"></div>
                <div class="cinema"></div>
                <div class="button"></div>
                <div class="screen"></div>
                <div class="probutton"></div>
                <div class="brobutton"></div>
            </div>
            <hr>
            <div class="RotateButton"></div>
        </body>
    </html>

      2.CSS代码

    *{
        list-style: none;
        text-decoration: none;
        font-family: "微软雅黑 UI";
        font-size: 14px;
        padding: 0;
        margin: 0;
    }
    body {
        padding: 20px;
        margin: 0 auto;
    }
    .phone {
        position: relative;
    }
    .body {
         240px;
        height: 400px;
        background-color: #daa520;
        border-radius: 5%;
    }
    .screen {
         240px;
        height: 340px;
        background-color: #444;
        position: absolute;
        top: 30px;
        left: 0;
    }
    .screen:before {
        content: 'HUAWEI';
        font-style: italic;
        position: absolute;
        top: 160px;
        left: 100px;
        color: #FFFFFF;
    }
    .cinema {
        background-color: #444;
        border-radius: 50%;
        position: absolute;
        top: 10px;
        left: 60px;
         10px;
        height: 10px;
    }
    .cinema:before {
        content: '';
        background-color: #444;
        border-radius: 50%;
        position: absolute;
        top: 0;
        left: 115px;
         10px;
        height: 10px;
    }
    .cinema:after {
        content: '';
        background-color: #444;
        border-radius: 15px;
        position: absolute;
        top: 2px;
        left: 28px;
         70px;
        height: 5px;
    }
    .button {
        border-radius: 0 10px 10px 0;
         3px;
        height: 50px;
        position: absolute;
        top: 40px;
        left: 240px;
        background-color: #DAA520;
    }
    .button:before {
        content: '';
        border-radius: 0 10px 10px 0;
         3px;
        height: 30px;
        position: absolute;
        top: 60px;
        left: 0;
        background-color: #DAA520;
    }
    .probutton {
         15px;
        height: 15px;
        border-radius: 50%;
        border: 2px solid #ffd700;
        position: absolute;
        top: 375px;
        left: 108px;
    }
    .probutton:before {
        content: '';
         13px;
        height: 13px;
        border-radius: 20%;
        border: 2px solid #FFD700;
        position: absolute;
        top: -2px;
        left: -80px;
    }
    .probutton:after {
        content: '';
        border-style: solid;
        border- 12px;
        border-color: transparent #FFD700 transparent transparent;
         0;
        height: 0;
        position: absolute;
        top: -4px;
        left: 74px;
    }

      备注:伪类before、after配合使用,减少标签使用量。

      Best wishes to you.

      LaoYu

      此文章为程序猿原创,特此声明。转载请注明出处,谢谢!

  • 相关阅读:
    2013 年最不可思议的 10 个硬件开源项目
    三款SDR平台对比:HackRF,bladeRF和USRP
    形同虚设:花费700美元便可突破门禁
    oracle timestamp和date区别
    linux服务器性能——CPU、内存、流量、磁盘使用率的监控
    通过安装memadmin对memcache进行可视化管理
    SNMP MIBs and IPv6
    使用 cacti 监控 windows 服务器硬盘的 I/O 状况
    snmp对超过16T的磁盘大小识别不对的解决办法
    源码编译安装net-snmp
  • 原文地址:https://www.cnblogs.com/yyy6/p/6049240.html
Copyright © 2011-2022 走看看