CSS实现箭头效果

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u012260672/article/details/51838792
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="Kingwell">
<meta name="Author" content="Kingwell Leng">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<style type="text/css">
body,td,div,tr,table{padding:0; margin:0}
table{width:50%; font-size:14px; font-family:Arial; color:#333}


.arrow-top,.arrow-right,.arrow-bottom,.arrow-left{font-size:0; line-height:0; height:0; width:0; cursor:pointer}
.box{ border:1px solid #CCC; width:100px; height:100px; padding:10px; background:#EEE; margin:10px}
.arrow{ border-width:50px; border-color:red green blue black; border-style:solid solid solid solid}
.arrow-bottom{ border-width:50px; border-color:red transparent transparent transparent;  border-style:solid dashed dashed dashed; border-bottom:none;}
.arrow-left{ border-width:50px; border-color:transparent green transparent transparent;  border-style:dashed solid dashed dashed; border-left:none;}
.arrow-top{ border-width:50px; border-color:transparent transparent blue transparent;  border-style:dashed dashed solid dashed; border-top:none;}
.arrow-right{ border-width:50px; border-color:transparent transparent transparent black;  border-style:dashed dashed dashed solid; border-right:none;}
</style>
<script type="text/javascript">

</script>
</head>
<body>
<table>
    <tr>
        <td>
            <div class="box">
                <div class="arrow"></div>
            </div>
        </td>
        <td>
        <p>.arrow{ border-width:50px; border-color:red green blue black; border-style:solid solid solid solid}</p>
        </td>
    </tr>
    <tr>
        <td>
            <div class="box">
                <div class="arrow-top"></div>
            </div>
        </td>
        <td>
        <p>.arrow-top{ border-width:50px; border-color:red transparent transparent transparent;  border-style:solid dashed dashed dashed; border-bottom:none;}
</p>
        </td>
    </tr>
    <tr>
        <td>
            <div class="box">
                <div class="arrow-right"></div>
            </div>
        </td>
        <td>
        <p>.arrow-right{ border-width:50px; border-color:transparent green transparent transparent;  border-style:dashed solid dashed dashed; border-left:none;}
</p>
        </td>
    </tr>
    <tr>
        <td>
            <div class="box">
                <div class="arrow-bottom"></div>
            </div>
        </td>
        <td>
        <p>.arrow-bottom{ border-width:50px; border-color:transparent transparent blue transparent;  border-style:dashed dashed solid dashed; border-top:none;}
</p>
        </td>
    </tr>
    <tr>
        <td>
            <div class="box">
                <div class="arrow-left"></div>
            </div>
        </td>
        <td>
        <p>.arrow-left{ border-width:50px; border-color:transparent transparent transparent black;  border-style:dashed dashed dashed solid; border-right:none;}
</p>
        </td>
    </tr>
</table>

</body>
</html>
阅读更多
换一批

没有更多推荐了,返回首页