我的导航包含许多元素(包括CSS hack三角形)。因此,我不知道如何为其添加插入样式边框。
基本上,这是我所拥有的: http://i.imgur.com/XVfLLtI.png
这是我想要的(在Photoshop中设计): http://i.imgur.com/tDjRXLo.png
HTML:
<div class="nav">
<div class="navbody">
<div class="navheader">
<a href="index.html" title="Home Page" style="text-decoration: none;color:inherit;"><img class="logo" src="images/logo.png">
<h1 class="GBHS" >GBHS</h1>
<h1 class="Athletics">ATHLETICS</h1></a>
</div>
<ul class="nav-menu">
<li><a href="#">House Points</a></li>
<li><a href="#">Results Entry</a></li>
<li><a href="#">Participation Entry</a></li>
<li><a href="#">Sign In / Sign Up</a></li>
</ul>
<img class="runico" src="images/run.png">
</div>
<div class="triangles"><div class="triangle1"></div><div class="triangle2"></div></div>
</div>
CSS:
.nav {
width: 282px;
float: left;
}
.navbody {
background-color: #afa094;
box-shadow: 0px 0px 40px 2px #202020;
text-align: center;
}
.navheader {
height: 130px;
}
.logo {
width: 70px;
float: left;
padding: 5px 0px 0px 22px;
}
.nav h1 {
margin: 0;
font-family: 'Open Sans', sans-serif;
text-align: left;
line-height: 26px;
}
.GBHS{color: #2f8168; padding-top: 10px;}.Athletics{color: #0b3d68;}
.nav-menu {
width: 192px;
margin: 0 auto;
font-size: 20px;
padding: 0;
}
.nav-menu li {
list-style: none;
border-bottom: 2px solid #fff;
}
.nav-menu li:last-child {
border-bottom: none;
}
.nav-menu li a {
padding: 10px 0;
display: block;
color: #102b42;
text-decoration: none;
}
.nav-menu li a:hover {
background-color: rgba(0, 0, 0, .05);
}
.runico {
width: 150px;
margin: 30px 0 30px 0;
}
.triangle1 {
display: inline-block;
border-right: 141px solid transparent;
border-left: 0px solid transparent;
border-top: 141px solid #afa094;
}
.triangle2 {
display: inline-block;
border-left: 141px solid transparent;
border-right: 0px solid transparent;
border-top: 141px solid #afa094;
}
FIDDLE: http://jsfiddle.net/JDzcP/不要担心图片不存在,他们仍占用空间。
ALSO 虽然我拥有stackoverflow社区的专业知识,但如何在三角形中添加框阴影?