首页 > 其他 > 详细

左边竖条的实现方法

时间:2017-04-27 09:29:39      阅读:153      评论:0      收藏:0      [点我收藏+]

一:border

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            *{margin:0px;padding:0px;}
            .wrap{width:500px;height:200px;margin:100px auto;}
            .wrap .con{width:400px;height:60px;border-left:5px solid purple;background: #ccc;}
        </style>
    </head>
    <body>
            <div class="wrap">
                <div class="con"></div>
            </div>
    </body>
</html>

 

二:伪类

 

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            *{margin:0px;padding:0px;}
            .wrap{width:500px;height:200px;margin:100px auto;}
            .wrap .con{width:400px;height:60px;background: #ccc;}
            .wrap .con:after{display: block;content:"";width:5px;height:60px;background: purple;}
        </style>
    </head>
    <body>
            <div class="wrap">
                <div class="con"></div>
            </div>
    </body>
</html>

 

三:box-shadow

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            *{margin:0px;padding:0px;}
            .wrap{width:500px;height:200px;margin:100px auto;}
            .wrap .con{width:400px;height:60px;background: #ccc;box-shadow:-5px 0px 0px purple;}
        </style>
    </head>
    <body>
            <div class="wrap">
                <div class="con"></div>
            </div>
    </body>
</html>

四:filter:drop-shadow

 

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            *{margin:0px;padding:0px;}
            .wrap{width:500px;height:200px;margin:100px auto;}
            .wrap .con{width:400px;height:60px;background: #ccc; -webkit-filter:drop-shadow(-5px 0 0 deeppink);}
        </style>
    </head>
    <body>
            <div class="wrap">
                <div class="con"></div>
            </div>
    </body>
</html>

 

五:渐变

 

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            *{margin:0px;padding:0px;}
            .wrap{width:500px;height:200px;margin:100px auto;}
            .wrap .con{width:400px;height:60px;background:-webkit-linear-gradient(left,purple 0px,purple 5px,#ccc 5px)}
        </style>
    </head>
    <body>
            <div class="wrap">
                <div class="con"></div>
            </div>
    </body>
</html>

 

左边竖条的实现方法

原文:http://www.cnblogs.com/yang0901/p/6772354.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!