Пользовательский CSS Bootstrap не работает должным образом
Я наткнулся на это меню CSS, которое я собираюсь включить в систему Bootstrap 3.
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Untitled 1</title>
</head>
<style>
#transnav ul li {
background:#000;
list-style: none;
height: 44px;
float:left;
padding:10px 5px;
}
#transnav ul li a {
width: 150px;
height: 40px;
line-height: 53px;
border-bottom: 4px solid #636393;
padding:0px;
color: #fff;
font-size:24px;
font-weight:lighter;
text-align:center;
text-decoration: none;
display: inline-block;
-webkit-transition: all 0.3s linear;
-moz-transition: all 0.3s linear;
-ms-transition: all 0.3s linear;
-o-transition: all 0.3s linear;
transition: all 0.3s linear;
}
#transnav li:nth-child(1) a {
border-color: #636393;
}
#transnav li:nth-child(2) a {
border-color: #B5222D;
}
#transnav li:nth-child(3) a {
border-color: #D4953C;
}
#transnav li:nth-child(4) a {
border-color: #609491;
}
#transnav li:nth-child(5) a {
border-color: #87A248;
}
#transnav li:nth-child(6) a {
border-color: #ff0000;
}
#transnav li:nth-child(1) a:hover {
border-bottom: 35px solid #636393;
height: 9px;
}
#transnav li:nth-child(2) a:hover {
border-bottom: 35px solid #B5222D;
height: 9px;
}
#transnav li:nth-child(3) a:hover {
border-bottom: 35px solid #D4953C;
height: 9px;
}
#transnav li:nth-child(4) a:hover {
border-bottom: 35px solid #609491;
height: 9px;
}
#transnav li:nth-child(5) a:hover {
border-bottom: 35px solid #87A248;
height: 9px;
}
#transnav li:nth-child(6) a:hover {
border-bottom: 35px solid #ff0000;
height: 9px;
}
</style>
<body>
<div id="transnav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Tutorials</a></li>
<li><a href="#">Coding</a></li>
<li><a href="#">WordPress</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Webmaster</a></li>
</ul>
</div>
</body>
Это работает как задумано, но когда я использую его в Bootstrap, он работает по-другому. Вот мой код начальной загрузки:
style.css
.transnav {
background-color: #000000;
height: 100px;
}
.transnav ul li {
background:#000;
list-style: none;
height: 44px;
float:left;
padding:10px 5px;
}
.transnav ul li a {
width: 150px;
height: 40px;
line-height: 53px;
border-bottom: 4px solid #636393;
padding:0px;
color: #fff;
font-size:24px;
font-weight:lighter;
text-align:center;
text-decoration: none;
display: block;
-webkit-transition: .2s all linear;
-moz-transition: .2s all linear;
-o-transition: .2s all linear;
transition: .2s all linear;
}
.transnav li:nth-child(1) a {
border-color: #636393;
}
.transnav li:nth-child(2) a {
border-color: #B5222D;
}
.transnav li:nth-child(3) a {
border-color: #D4953C;
}
.transnav li:nth-child(4) a {
border-color: #609491;
}
.transnav li:nth-child(5) a {
border-color: #87A248;
}
.transnav li:nth-child(6) a {
border-color: #ff0000;
}
.transnav li:nth-child(1) a:hover {
border-bottom: 35px solid #636393;
height: 9px;
}
.transnav li:nth-child(2) a:hover {
border-bottom: 35px solid #B5222D;
height: 9px;
}
.transnav li:nth-child(3) a:hover {
border-bottom: 35px solid #D4953C;
height: 9px;
}
.transnav li:nth-child(4) a:hover {
border-bottom: 35px solid #609491;
height: 9px;
}
.transnav li:nth-child(5) a:hover {
border-bottom: 35px solid #87A248;
height: 9px;
}
.transnav li:nth-child(6) a:hover {
border-bottom: 35px solid #ff0000;
height: 9px;
}
Страница начальной загрузки:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title></title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="font-awesome-4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- Custom CSS -->
<link href="css/style.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Navigation -->
<div class="container">
<div class="transnav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Tutorials</a></li>
<li><a href="#">Coding</a></li>
<li><a href="#">WordPress</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Webmaster</a></li>
</ul>
</div>
</div>
<!-- jQuery Version 1.11.0 -->
<script src="jquery/jquery-1.11.1.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>