<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="jquery.js"></script>
<style type="text/css">
body{
background:green;
}
/*导航菜单*/
.block_nav{
position:relative;
top:100px;
width:200px;
height:100px;
background:navy;
}
.sl1,.sl2 {
display: block;
height: 0px;
width: 0px;
position: absolute;
font-size: 0;
line-height:0;
}
.sl1{
top:60%;
right: -20px; /* 它来确定尖角的位置 */
border-right: 10px solid transparent;
border-left: 10px solid navy; /* 注意颜色的变化 */
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
}
.sl2{
right:-10px; /* 是自身边框宽度的2倍 */
top: -5px; /* 是自身边框宽度的-1倍 */
border-right: 10px solid transparent;
border-left: 10px solid navy;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
}
</style>
<script type="text/javascript">
</script>
</head>
<body>
<!-- 导航菜单 -->
<div class="block_nav ">
<span class="sl1"><span class="sl2"></span></span>
</div>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="jquery.js"></script>
<style type="text/css">
body{
background:green;
}
/*导航菜单*/
.block_nav{
position:relative;
top:100px;
width:200px;
height:100px;
background:navy;
}
.sl1,.sl2 {
display: block;
height: 0px;
width: 0px;
position: absolute;
font-size: 0;
line-height:0;
}
.sl1{
top:60%;
right: -20px; /* 它来确定尖角的位置 */
border-right: 10px solid transparent;
border-left: 10px solid navy; /* 注意颜色的变化 */
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
}
.sl2{
right:-10px; /* 是自身边框宽度的2倍 */
top: -5px; /* 是自身边框宽度的-1倍 */
border-right: 10px solid transparent;
border-left: 10px solid navy;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
}
</style>
<script type="text/javascript">
</script>
</head>
<body>
<!-- 导航菜单 -->
<div class="block_nav ">
<span class="sl1"><span class="sl2"></span></span>
</div>
</body>
</html>