我有一个Twitter Bootstrap Navbar,除了下拉菜单偏移了40个像素并且在下拉列表的左边有一个奇怪的阴影图形外,一切都运行良好。
我已经检查过它以确定它可能是什么,试图重置半径,边距和填充但是都无济于事。
如果我知道它是什么,那将是一个很大的帮助。
更新
谢谢Christian Varga,奇怪的形状确实是盒子阴影,我已经删除了它。我只剩下看起来像40像素的左边距包裹整个下拉列表。
我已经发布了HTML和CSS
HTML
<body>
<header>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href=@Url.Action("Index", "Home", new { Area = ""}) class="navbar-brand"><img id="alogo" src="~/Content/images/logos/logo.png" /></a>
</div>
<nav class="nav navbar-collapse collapse">
<ul class="navbar-right">
<li>
<a href=@Url.Action("Index", "Controller", new { Area = "AreaName"})><i class="fa fa-bar-chart-o fa-2x"></i><br />Top Level</a>
<ul>
<li><a href=@Url.Action("Index", "Controller", new { Area = "AreaName"})>Drop Down 1</a></li>
<li><a href=@Url.Action("Details", "Controller", new { Area = "AreaName" })>Drop Down 2</a></li>
</ul>
</li>
</ul>
</nav>
</div>
</div>
CSS
/*Nav Bar Styling*/
.nav {
background-color: #3B5998;
width: auto;
}
.navbar-inverse {
background-color: #3B5998;
border-color: #E7E7E7;
}
.nav ul; {
margin: 0;
padding: 0;
}
.nav ul li {
list-style: none;
display: inline-block;
margin: 0;
}
.nav ul li a {
display: block;
text-decoration: none;
text-align: center;
/*left upper right bottom*/
padding: 10px 10px 10px 10px;
color: #FFFFFF;
font-size: 14px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
transition: color 0.5s, background 0.5s;
-webkit-transition: color 0.5s, background 0.5s; /* Safari */
}
.nav ul li:hover a {
color: #efefef;
padding-bottom: 10px;
background-color: #293E6A;
transition: color 0.5s, background 0.5s;
-webkit-transition: color 0.5s, background 0.5s; /* Safari */
}
/* Drop Down */
.nav ul li ul {
display: none;
}
.nav ul li:hover ul {
z-index: 2;
position: absolute;
display: block;
}
.nav ul li ul {
position: relative;
/*-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;*/
}
.nav ul li ul:before, .nav ul li ul:after {
content: "";
position: absolute;
z-index: -1;
/*-webkit-box-shadow: 0 0 20px rgba(0,0,0,0.8);
-moz-box-shadow: 0 0 20px rgba(0,0,0,0.8);
box-shadow: 0 0 20px rgba(0,0,0,0.8);*/
top: 50%;
bottom: 0;
left: 10px;
right: 10px;
-moz-border-radius: 100px / 10px;
border-radius: 100px / 10px;
}
.nav ul li ul li {
list-style: none;
display: block;
float: none;
}
.nav ul li ul li:hover a {
color: #293E6A;
padding-bottom: 10px;
background-color: #efefef;
transition: color 0.5s, background 0.5s;
-webkit-transition: color 0.5s, background 0.5s; /* Safari */
}
.nav ul li ul li {
}
.nav ul li ul li a {
padding: 5px 15px 5px 15px;
text-align: left;
}
.nav ul li ul li a i {
min-width: 20px;
padding-right: 10px;
}
/* Drop Down Arrow */
.nav li > a:after {
content: ' »';
}
.nav > li > a:after {
content: ' »';
}
.nav li > a:only-child:after {
content: '';
}
/* Active Class */
.nav ul .active {
color: #FFF;
}
.navbar-brand {
padding: 0px 0px 0px 0px;
margin: 15px 0px 0px 0px;
}
</style>