HTML5

 

navbar.css

<style>
.navbar-default {
    background-color: #2b56be;
    border-color: #2248a5;
}
.navbar-default .navbar-brand {
    color: #fff;
}
.navbar-default .navbar-nav>li>a {
    color: #fff;
}
.navbar-default:hover .navbar-nav>li>a:hover {
    color: #fff !important;
}
.navbar-brand:hover, .navbar-brand:focus{
	 color: #fff !important;	
}

.navbar-default .navbar-nav>.active>a  {
    color: #fff !important;
    background-color: #1942a5;       
}


#navbar .navbar-nav li.active a::after {
    position: absolute;
    content: "";
    display: block;
    border-bottom: 2px solid #fff;
    transition: all 250ms ease-out;
   left: 15%;
    width: 70%;
}


.navbar-default .navbar-nav > .active >a:hover  {
    color: #fff !important;
    background-color: #102d72;
}


#navbar .navbar-nav li a::after  ,.navbar-default .navbar-nav>.active>a::after {
    position: absolute;
    content: "";
    display: block;
    border-bottom: 2px solid #fff;
    transition: all 250ms ease-out;
    left: 50%;
    width: 0;
}
#navbar .navbar-nav li a:hover::after ,.navbar-default .navbar-nav>.active>a:hover::after {
    transition: all 250ms ease-out;
    left: 15%;
    width: 70%;
}

.navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:focus, .navbar-default .navbar-nav>.open>a:hover {
    color: #fff;
    background-color: #1942a5;
}

</style>    
<!-- Fixed navbar -->
    <nav class="navbar navbar-default navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <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="#">Project name</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
            <li class="active"><a href="#">Home</a></li>
            <li><a href="#about">About</a></li>
            <li><a href="#contact">Contact</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Dropdown <span class="caret"></span></a>
              <ul class="dropdown-menu" role="menu">
                <li><a href="#">Action</a></li>
                <li><a href="#">Another action</a></li>
                <li><a href="#">Something else here</a></li>
                <li class="divider"></li>
                <li class="dropdown-header">Nav header</li>
                <li><a href="#">Separated link</a></li>
                <li><a href="#">One more separated link</a></li>
              </ul>
            </li>
          </ul>
          <ul class="nav navbar-nav navbar-right">
            <li><a href="../navbar/">Default</a></li>
            <li><a href="../navbar-static-top/">Static top</a></li>
            <li class="active"><a href="./">Fixed top <span class="sr-only">(current)</span></a></li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>    
    
    <div class="mb-5"style="margin-bottom: 100px"></div>
    
    

 

html

 

about author

PHRASE

Level 60  라이트

그 사람의 말을 듣고 그 사람의 눈동자를 보면 그 사람을 알 수가 있다. 그 사람이 어떻게 해서 자기를 숨길 수가 있단 말인가. -맹자

댓글 ( 4)

댓글 남기기

작성