I have a page layout which works fine and it’s one that I don’t want to mess with (unless I have to). I’m not adept at javascript so I found an example online. The problem I’m getting is that when using my accordion menu, the submenu is offset to the right. I used some inline CSS in the html itself and used the !important command to override the automatic padding that’s on the list elements. This doesn’t seem to be having any effect. JS fiddle here. There’s tons of autogenerated commented code in there so it’s going to be messy, I just needed all of it to show the example of what the accordion submenu looks like. Why isn’t the inline CSS overriding the external CSS file? Why isn’t the !important keyword working?
I thought there was some padding going on but
ul { is in my external CSS file, and padding is obviously set to 0.
padding: 0;
margin: 0;
}
Here is the CSS that makes the accordion work.
<style type="text/css">
#accordionNav {
float: left;
width: 560px;
list-style:none;
padding:none;
}
#accordionNav li a {
display: block;
padding:5px;
background: #ccc;
border-top: 1px solid #eee;
border-bottom: 1px solid #999;
text-decoration: none;
color: #000;
list-style:none;
padding:none !important;
width: 560px;
}
#accordionNav li a:hover, #accordionNav li a.active {
background: #999;
color: #fff;
}
#accordionNav li ul {
display: none;
list-style:none;
padding:none !important;
}
#accordionNav li ul li a {
padding:0 0 0;
background: #ececec;
list-style:none;
padding:none !important;
}
Any idea what it could be that’s keeping the sub menu from aligning properly?
You used:
instead of