/    Sign up×
Community /Pin to ProfileBookmark

!important messes up menu

here is the code I have for a drop-down menu

[code=php]#zUL,#zUL ul {padding:0 0 0 5px;margin:0; font-weight: bold;
font-size: 10pt;
line-height: 1;
font-family: Tahoma, Arial, Verdana, Helvetica, Sans-Serif;
text-decoration: none;
background-color: #483d8b;
text-align: center;
width:780px;
height: 1.3em;}

#zUL a {color:#FFFFFF; text-decoration:none; background-color:#483d8b; padding-top:-3px; padding-bottom:2px}

#zUL li ul a {margin-left:1em}

#zUL li {text-decoration:none; background-color:#483d8b; text-align:left;
float:left;
width:9.5em;
position:relative;
list-style-type:none;
font-weight:600;
}
#zUL li ul li {background-color:#483d8b}

#zUL li ul {visibility:hidden;
position:absolute;
width:9em; background-color:#483d8b; margin:0; text-align:left;}

#zUL li ul ul {text-decoration:none; margin:-1em 0 0 9.7em; width:auto; text-align:left; background-color:#483d8b; visibility:hidden; position:absolute;}

fieldset p {clear:left}

#zUL li:hover ul, #zUL li.msieFix ul, #zUL li:hover ul ul, #zUL li.msieFix ul ul {
visibility:visible;
background-color:#483d8b;}

* html fieldset p {z-index:-1}
* html #zUL li:hover ul,
* html #zUL li.msieFix ul {
top:1em;
left:.2em
}[/code]

What I need to do is change the “#zUL,#zUL ul” part of it with the !important…uh, thing…to specify different widths for IE and the rest of the browsers. So this is what I change that section to:

[code=php]#zUL,#zUL ul {padding:0 0 0 5px;margin:0; font-weight: bold;
font-size: 10pt;
line-height: 1;
font-family: Tahoma, Arial, Verdana, Helvetica, Sans-Serif;
text-decoration: none;
background-color: #483d8b;
text-align: center;
width:775px !important;
width:780px;
height: 1.3em;}[/code]

And that works…only it messes up the lower levels of the drop down menu. They come out horizontally instead of vertically (at least, that’s the way it looks) Does anyone know why it does that?

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@hooloovoo24authorJul 21.2005 — also, even without the !important, the edges of the submenus are funky and I can't figure out how to make them line up. See picture:

[upl-file uuid=56715ade-da50-40b7-a2dd-b1bf2f89ca5e size=40kB]weirdedges.jpg[/upl-file]
×

Success!

Help @hooloovoo24 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...