这是一个问题,我有:http://i.stack.imgur.com/i80Yl.jpg。 这是Bootstrap菜单的一部分。 添加了一些更多的信息
<link rel="stylesheet" type="text/css" href="view/stylesheet/stylesheet.css" />
<link rel="stylesheet" type="text/css" href="view/stylesheet/bootstrap.css" />
但是当我想要覆盖我需要使用的任何Bootstrap选项时!重要的是。我不想改变Bootstrap css。
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://localhost/Web/E-Shop/admin/index.php?route=common/home&token=dac2fdfed5ea52154c40dd0ad17dbe92">Obchod</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Catalog<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=catalog/category&token=dac2fdfed5ea52154c40dd0ad17dbe92"> Categories</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=catalog/product&token=dac2fdfed5ea52154c40dd0ad17dbe92">Products</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=catalog/filter&token=dac2fdfed5ea52154c40dd0ad17dbe92">Filters</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=catalog/profile&token=dac2fdfed5ea52154c40dd0ad17dbe92">Profiles</a></li>
<li class="divider"></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=catalog/attribute&token=dac2fdfed5ea52154c40dd0ad17dbe92">Attributes</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=catalog/attribute_group&token=dac2fdfed5ea52154c40dd0ad17dbe92">Attribute Groups</a></li>
<li class="divider"></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=catalog/option&token=dac2fdfed5ea52154c40dd0ad17dbe92">Options</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=catalog/manufacturer&token=dac2fdfed5ea52154c40dd0ad17dbe92">Manufacturers</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=catalog/download&token=dac2fdfed5ea52154c40dd0ad17dbe92">Downloads</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=catalog/review&token=dac2fdfed5ea52154c40dd0ad17dbe92">Reviews</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=catalog/information&token=dac2fdfed5ea52154c40dd0ad17dbe92">Information</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Extensions<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=extension/module&token=dac2fdfed5ea52154c40dd0ad17dbe92">Modules</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=extension/shipping&token=dac2fdfed5ea52154c40dd0ad17dbe92">Shipping</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=extension/payment&token=dac2fdfed5ea52154c40dd0ad17dbe92">Payments</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=extension/total&token=dac2fdfed5ea52154c40dd0ad17dbe92">Order Totals</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=extension/feed&token=dac2fdfed5ea52154c40dd0ad17dbe92">Product Feeds</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Sales<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=sale/order&token=dac2fdfed5ea52154c40dd0ad17dbe92">Orders</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=sale/recurring&token=dac2fdfed5ea52154c40dd0ad17dbe92">Recurring Profiles</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=sale/return&token=dac2fdfed5ea52154c40dd0ad17dbe92">Returns</a></li>
<li class="divider"></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=sale/customer&token=dac2fdfed5ea52154c40dd0ad17dbe92">Customers</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=sale/customer_group&token=dac2fdfed5ea52154c40dd0ad17dbe92">Customer Groups</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=sale/customer_ban_ip&token=dac2fdfed5ea52154c40dd0ad17dbe92">Banned IP</a></li>
<li class="divider"></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=sale/affiliate&token=dac2fdfed5ea52154c40dd0ad17dbe92">Affiliates</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=sale/coupon&token=dac2fdfed5ea52154c40dd0ad17dbe92">Coupons</a></li>
<li class="divider"></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=sale/voucher&token=dac2fdfed5ea52154c40dd0ad17dbe92">Gift Vouchers</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=sale/voucher_theme&token=dac2fdfed5ea52154c40dd0ad17dbe92">Voucher Themes</a></li>
<li class="divider"></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=sale/contact&token=dac2fdfed5ea52154c40dd0ad17dbe92">Mail</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">System<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=setting/store&token=dac2fdfed5ea52154c40dd0ad17dbe92">Settings</a></li>
<li class="divider"></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=design/layout&token=dac2fdfed5ea52154c40dd0ad17dbe92">Layouts</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=design/banner&token=dac2fdfed5ea52154c40dd0ad17dbe92">Banners</a></li>
<li class="divider"></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=user/user&token=dac2fdfed5ea52154c40dd0ad17dbe92">Users</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=user/user_permission&token=dac2fdfed5ea52154c40dd0ad17dbe92">User Groups</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Localisation<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=localisation/language&token=dac2fdfed5ea52154c40dd0ad17dbe92">Languages</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=localisation/currency&token=dac2fdfed5ea52154c40dd0ad17dbe92">Currencies</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=localisation/stock_status&token=dac2fdfed5ea52154c40dd0ad17dbe92">Stock Statuses</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=localisation/order_status&token=dac2fdfed5ea52154c40dd0ad17dbe92">Order Statuses</a></li>
<li class="divider"></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=localisation/return_status&token=dac2fdfed5ea52154c40dd0ad17dbe92">Return Statuses</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=localisation/return_action&token=dac2fdfed5ea52154c40dd0ad17dbe92">Return Actions</a></li>
<li class="divider"></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=localisation/country&token=dac2fdfed5ea52154c40dd0ad17dbe92">Countries</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=localisation/zone&token=dac2fdfed5ea52154c40dd0ad17dbe92">Zones</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=localisation/geo_zone&token=dac2fdfed5ea52154c40dd0ad17dbe92">Geo Zones</a></li>
<li class="divider"></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=localisation/tax_class&token=dac2fdfed5ea52154c40dd0ad17dbe92">Tax Classes</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=localisation/tax_rate&token=dac2fdfed5ea52154c40dd0ad17dbe92">Tax Rates</a></li>
<li class="divider"></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=localisation/length_class&token=dac2fdfed5ea52154c40dd0ad17dbe92">Length Classes</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=localisation/weight_class&token=dac2fdfed5ea52154c40dd0ad17dbe92">Weight Classes</a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=tool/error_log&token=dac2fdfed5ea52154c40dd0ad17dbe92">Error Logs</a></li>
<li><a href="http://localhost/Web/E-Shop/admin/index.php?route=tool/backup&token=dac2fdfed5ea52154c40dd0ad17dbe92">Backup / Restore</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
.navbar-default {
background-color: #00598e !important;
border-color: none !important;
color: #fff !important;
}
.navbar-default .navbar-nav > li > a {
color: #fff !important;
}
.navbar-default .navbar-brand {
color: #FFF !important;
}
.dropdown .open{
}
.dropdown:hover .dropdown-menu {
display: block;
}
.dropdown:hover {
background-color: #0077c0;
}
.vertical-offset-100{
padding-top:100px;
}
.footer-s{
position:fixed;
left:0px;
bottom:0px;
width:100%;
}
.alert{
margin-top: 30px;
}
.nav .open>a, .nav .open>a:hover, .nav .open>a:focus {
background-color: #00598e;
border-color: #00598e;
}
.dropdown-menu>li>ul>li>a:hover, .dropdown-menu>li>ul>li>a:focus{
text-decoration: none;
color: #262626;
background-color: #F5F5F5;
}
.container{
margin-top: 50px;
}
.btn>a:hover,
.btn>a:focus,
.btn>a {
color: #fff;
text-decoration: none;
}
.scrollbox{
height: 120px;
width: auto;
border: 1px solid #ccc;
overflow: auto;
}
.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus {
color: #FFF;
background-color: #0077c0 !important;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #FFF !important;
}
答案 0 :(得分:1)
我建议您在boostrap CSS文件下面(之后)移动覆盖或自定义样式表。然后,您不需要尽可能多地使用!important
。请记住,您需要在自定义样式表中匹配或超过相同的特异性才能进行覆盖。
<link rel="stylesheet" type="text/css" href="view/stylesheet/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="view/stylesheet/stylesheet.css" /> <!-- moved below bootstrap.css -->