Shreygupta (Talk | contribs) |
Shreygupta (Talk | contribs) |
||
Line 36: | Line 36: | ||
float: left; | float: left; | ||
font-size: 20px; | font-size: 20px; | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
} | } | ||
#inPageNav { | #inPageNav { | ||
Line 97: | Line 77: | ||
margin: 0 0 30px 0; | margin: 0 0 30px 0; | ||
line-height: 2; | line-height: 2; | ||
+ | .navbar { | ||
+ | overflow: hidden; | ||
+ | background-color: #333; | ||
+ | font-family: Arial; | ||
} | } | ||
− | + | ||
− | + | .navbar a { | |
− | + | float: right; | |
− | + | font-size: 16px; | |
− | + | color: white; | |
− | + | text-align: center; | |
+ | padding: 14px 16px; | ||
+ | text-decoration: none; | ||
} | } | ||
+ | .dropdown { | ||
+ | float: right; | ||
+ | overflow: hidden; | ||
+ | } | ||
+ | |||
+ | .dropdown .dropbtn { | ||
+ | font-size: 16px; | ||
+ | border: none; | ||
+ | outline: none; | ||
+ | color: white; | ||
+ | padding: 14px 16px; | ||
+ | background-color: inherit; | ||
+ | } | ||
+ | |||
+ | .navbar a:hover, .dropdown:hover .dropbtn { | ||
+ | background-color: red; | ||
+ | } | ||
+ | |||
+ | .dropdown-content { | ||
+ | display: none; | ||
+ | position: absolute; | ||
+ | background-color: #f9f9f9; | ||
+ | min-width: 160px; | ||
+ | box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); | ||
+ | z-index: 1; | ||
+ | } | ||
+ | |||
+ | .dropdown-content a { | ||
+ | float: none; | ||
+ | color: black; | ||
+ | padding: 12px 16px; | ||
+ | text-decoration: none; | ||
+ | display: block; | ||
+ | text-align: left; | ||
+ | } | ||
+ | |||
+ | .dropdown-content a:hover { | ||
+ | background-color: #ddd; | ||
+ | } | ||
+ | |||
+ | .dropdown:hover .dropdown-content { | ||
+ | display: block; | ||
+ | } | ||
+ | #logoImg { | ||
+ | float: left; | ||
+ | } | ||
+ | |||
+ | } | ||
Line 113: | Line 147: | ||
<body> | <body> | ||
<div id="contentWrapper"> | <div id="contentWrapper"> | ||
− | < | + | <div style="position: fixed; width: 100%; top: 0; left: 0;"> |
− | + | <div class="navbar"> | |
− | + | <a href="#" id="logoImg">Logo here</a> | |
− | + | <a href="#home">Home</a> | |
− | + | <a href="#news">News</a> | |
− | + | <div class="dropdown"> | |
− | + | <button class="dropbtn">Dropdown | |
+ | </button> | ||
+ | <div class="dropdown-content"> | ||
+ | <a href="#">Link 1</a> | ||
+ | <a href="#">Link 2</a> | ||
+ | <a href="#">Link 3</a> | ||
+ | </div> | ||
+ | </div> | ||
+ | </div> | ||
+ | </div> | ||
</div> | </div> | ||
</body> | </body> | ||
</html> | </html> |
Revision as of 11:47, 7 October 2017