html5 - Dropdown Problems on Navbar -
Sorry if this is so easy, but I'm having problems with my navbar which I am making.
I have problems when hovering over If you want to see an example here If any of these require Jquery or regular JS, which I do not think it does, then I would reply here. I am This is my code. Fixed: converted to CSS: ul of the dropdown menu
li is not set as active and another issue is that when you < Code> ul , the link is pushed on the right side.
HTML
& lt; Div class = "navbar" & gt; & Lt; A href = "#" class = "brand" & gt; & Lt; Img src = "img / shattered.png" / & gt; Test & lt; / A & gt; & Lt; Ul class = "navbar-nav" & gt; & Lt; Div class = "container" & gt; & Lt; Li class = "active" & gt; & Lt; A href = "#" & gt; Active & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Hover & lt; / A & gt; & Lt; / Li & gt; & Lt; Li class = "dropdown" & gt; & Lt; A href = "#" & gt; Dropdown & lt; B square = "carat" & gt; & Lt; / B & gt; & Lt; / A & gt; & Lt; Ul class = "dropdown menu" & gt; & Lt; Li class = "active" & gt; & Lt; A href = "#" & gt; Inbox & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Draft & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Sent items & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Trash & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Div & gt; & Lt; / Ul & gt; & Lt; / Div & gt;
CSS
body {margin: 0; Background Image: URL (../img/shattered.png); Background position: center; Background repeat: repeat; Font-family: helvetica, sans-serif; }. Container {Padding: 0 10%; } .navbar {status: fixed; Top: 0; Width: 100%; } .navbar-nav {background-color: #fff; Minute-height: 50px; Border bottom: 3px solid # ccc; Padding-right: 10px; Margin: 0; } .navbar .brand {margin-left: 50px; Margin-right: 50px; Display: inline-block; Color: # 333; Font-size: 20px; Text-decoration: none; Swim left; Line-height: 50px; } .navbar .brand: hover {animation: shake .75 s; Webkit-Animation: Shake .75s; -MOZ-Animation: Shake .75 s; -a-animation: shake .75s; } .navbar .brand img {padding-right: 10px; Height: 50px; Width: 50px; Swim left; } .navbar-nav li {display: inline-block; Margin-right: -4px; List-style: none; } .navbar-nav & gt; Container & gt; Le & gt; A {font-size: 17px; Display: inline-block; Text-decoration: none; Color: # 333; Padding: 15px 15px; } .navbar-nav & gt; Container & gt; Le & gt; One: hover {background color: #iffeff; Transition: Ease Out-Out. 25 S; } .navbar-nav & gt; Container & gt; . Active & gt; A {background color: #ddd; } .navbar-nav & gt; Container & gt; . Active & gt; One: hover {background color: #ddd; } .navbar-nav & gt; Container & gt; .pull-right {float: right; } .navbar-nav & gt; Container & gt; Le & gt; One & gt; .caret {Display: Inline-Block; Width: 0 pixels; Height: 0 pixels; Margin-left: 2px; Vertical-row: middle; Border bottom: None; Border-top: 4px solid # 333; Border-right: 4px solid transparent; Border-left: 4px solid transparent; Border-bottom-width: 0 pixels; Border-top-style: dotted; } .navbar-nav & gt; Container & gt; Li ul {display: none; } .navbar-nav & gt; Container & gt; Li: Hover UL {display: block; Background color: #fff; Status: Completed; Border-bottom-right-radius: 5px; Border-bottom-left-radius: 5px; } .navbar-nav & gt; Container & gt; Le & gt; UL & gt; Li {display: Block; } .navbar-nav & gt; Container & gt; Le & gt; UL & gt; Le & gt; A {display: block; Padding: 5px 20px; Text-decoration: none; Font-size: 15px; } .navbar-nav & gt; Container & gt; Le & gt; UL & gt; Le & gt; One: hover {background-color: # by; }
ul padding: 0; Fixed padding in / * ul. Active. Active: Hover {background color: #ddd; }
Comments
Post a Comment