添加收货地址展示

效果图


image.png

关于switch开关,主要在于将checkbox的-webkit-appearance属性设置为none,其他都是样式的调整
1.html

<div>
            <div class="block"></div>
            <div class="address_content">
                <ul>
                    <li>
                        <label>收货人姓名</label><input type="text" placeholder="请输入收货人姓名" id="" value="" />
                    </li>
                    <li>
                        <label>手机号</label><input type="text" placeholder="请输入收货人姓名" id="" value="" />
                    </li>
                    <li>
                        <label>邮政编码</label><input type="text" placeholder="请输入邮政编码" id="" value="" />
                    </li>
                </ul>
            </div>
            <div class="block"></div>
            <div class="address_content_1">
                <ul>
                    <li>
                        <label>所在地区</label><img src="img/right.png" class="right_iccon"/><span class="select">请选择</span>
                    </li>
                    <li style="height: 80px;">
                        <label>详细地址</label><textarea name="" placeholder="请输入详细地址信息,如道路、门牌号、小区、楼栋号、单元室等"></textarea>
                    </li>
                    <li>
                        <label>设置默认地址</label><label style="float: right;width: 60px;height: 30px;margin-right: 15px;"><input type="checkbox" checked="checked" class="switch location" name="" id="" value="" /></label>
                    </li>
                </ul>
            </div>
            <div class="comfirmBtn">
                确定
            </div>
        </div>

2.css

.address_content{
    padding-left: 10px;
}
.address_content ul{
    margin: 0;
    padding: 0;
    list-style: none;
}
.address_content ul li{
    height: 60px;
    line-height: 60px;
    border-bottom: 1px solid #E4E4E4;
}
.address_content_1{
    padding-left: 10px;
}
.address_content_1 ul{
    margin: 0;
    padding: 0;
    list-style: none;
}
.address_content_1 ul li{
    height: 60px;
    line-height: 60px;
    border-bottom: 1px solid #E4E4E4;
}
.address_content label{
    font-size: 14px;
    width: 110px;
    display: inline-block;
}
.address_content_1 label{
    font-size: 14px;
    width: 110px;
    display: inline-block;
}
.block{
    width: 100%;
    height: 10px;
    background-color: #F5F5F5;
}
.comfirmBtn{
    width: calc(100% - 40px);
    height: 50px;
    line-height: 50px;
    border-radius: 4px;
    text-align: center;
    background-color: royalblue;
    margin-top: 20px;
    margin-left: 20px;
    color: white;
    font-size: 18px;
}
.address_content input{
    line-height: 30px;
    height: 30px;
    border: none;
    box-sizing: border-box; 
    width: calc(100% - 110px);
    font-size: 13px;
    border-radius: 3px;
}
.address_content input:focus { 
    outline: none;
    border: none;
}
.address_content_1 textarea{
    line-height: 25px;
    height: 60px;
    border: none;
    box-sizing: border-box; 
    width: calc(100% - 110px);
    font-size: 14px;
    border-radius: 3px;
    float: right;
    padding: 5px 0px;
    margin-top: 10px;
}
.address_content_1 textarea:focus { 
    outline: none;
    border: none;
}
.right_iccon{
    width: 20px;
    height: 20px;
    vertical-align:middle;
    float:right;
    margin-top: 20px;
    margin-right: 15px;
}
.select{
    float:right;
    margin-right: 5px;
    color: #a9a9a9;
    font-size: 14px;
}
.address_detail{
    height: 80px;
}
.switch{
    width: 60px;
    height: 30px;
    border-radius: 20px;
    -webkit-appearance: none;
    user-select: none;
    outline: none; 
    background-color: #e0e0e0;
    box-shadow: #c2c2c2 0 0 0 0 inset;
    position: relative;
    transition:0.4s;
}
.switch:before{
    content: '';
    width: 28px;
    height: 28px;
    border-radius: 100%;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); 
    position: absolute;
    left:0;
    top:1px;
    transition:0.3s;
}
.switch:checked{
    border-color: royalblue;
    background-color: royalblue; 
}
.switch:checked:before{
    left:32px;
}
.location{
    margin: 15px 15px 15px 0px;
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 第一部分 HTML&CSS整理答案 1. 什么是HTML5? 答:HTML5是最新的HTML标准。 注意:讲述HT...
    kismetajun阅读 27,750评论 1 45
  • 译者:旭日云中竹链接:http://www.zcfy.cc/article/1057原文:https://medi...
    IT程序狮阅读 6,084评论 8 200
  • 课程目标: 学会使用CSS选择器熟记CSS样式和外观属性熟练掌握CSS各种选择器熟练掌握CSS各种选择器熟练掌握C...
    繁华退却阅读 1,764评论 0 0
  • •前端面试题汇总 一、HTML和CSS 21 你做的页面在哪些流览器测试过?这些浏览器的内核分别是什么? ...
    Simon_s阅读 2,228评论 0 8
  • 问答题47 /72 常见浏览器兼容性问题与解决方案? 参考答案 (1)浏览器兼容问题一:不同浏览器的标签默认的外补...
    _Yfling阅读 13,815评论 1 92