Forum Moderators: not2easy
CSS
============
#nav {
/*filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=image src='img/selectArea.png');
background-repeat:no-repeat;*/
background: url(../img/selectArea.png) no-repeat;
width:588px;
height:125px;
margin-top:-33px;
margin-bottom:-18px;
position:relative;
z-index:2;
}
#nav ul {
margin-top:5px;
margin-left:-200px;
border:solid red 1px;
}
#nav ul li {
font-family:Helvetica, Arial, sans-serif;
font-size:14px;
margin:auto;
display:block;
background:url(../img/buttonImg.gif) no-repeat center;
padding-left:25px;
padding-right:5px;
float:left;
}
(I commented out the setup that makes transparency work and the part not commented is not transparent but with working links)
I don't think I'm understanding *your* question very well...
Are you trying to have links on top of some kind of header image (or something like that)? Why are you using transparent images behind your links?
I'm thinking I don't understand your question very well, but from what I *do* get from it...why don't you just have a div with your image set as the background, and remove the background from the links? Then the image is still there, and the links will function.
Is this what you mean?
These are all within that nav div. The problem I'm having is making the nav background image transparent in IE without losing the function of the list links.
*a {
position:relative!important;
}
#nav ul li a:link,
a:visited,
a:hover,
a:active {
color: #069;
text-decoration:none;
}
#nav ul li a:hover {
color:#c00;
}
Okay. Well, the guy before me had a good suggestion - sometimes IE just wants you to get *really* sepcific. Another suggestion (in regards to specificity) would be to also add in "a", alongside "a:link" - I've found sometimes if you don't have them both, then IE will ignore links. (Yes, I know how have it specified elsewhere, but not for the #nav ul li stuff - you have the default set.)
So now, I'm getting your issue. When the background is transparent, then typically the only way you can click a link is if you're actually hovering over a letter, right?
Why don't you try setting your links - instead of "position:relative", set them as "display:block, float:left;" and set a width for them. So if you set tham at say, 150pixels wide, then for 150 pixles you'll be hovering over the link whether you're on a letter or not. (I believe this also helps the background display a bit better.)
Just remember to clear your floats underneath the nav bar. And hopefully my light bulb got slightly brighter there ;)
When using the filtered image, you cannot click the link even if your mouse is over the letter itself. There is no hover and you're not able to visit. For some reason the image doesn't act as a background and covers the link. If I take out the position:relative on the nav div, the links work, but I lose transparency. It's been driving me crazy, but I'm glad I have some help now.
As you see, the nav div is position to be transparent over the bottom part of the banner image and the top part of the content caontainer below it. I'm working on putting a stager up so you can visit it and see what's going on for yourself.
Jst one suggestion to try: you may want to validate your code. It's no guarantee that it will "make everything fall into place", but sometimes it does happen, simply because if the syntax isn't correct, it'll force the browser in to "quirks" mode, which will sometimes display your site unexpectedly. If it validates, the browsers will render your code correctly, and if the CSs is right, then it'll snap back into place.
As I've said, there's no guarantee of that - but sometimes it happens.
I *would* like to see the site - I'm more of a visual person - but I'm afraid if you post the link, the mods will remove it (they don't like links to outside sites here). So could you also PM it to me too? Thanks :)
Now, what I'm seeing here is basically a header div and towards the bottom of the header, you want to have your links. To me, looking at the code, you're overthinking your problem.
Okay, first off - agh! Javascript to determine the browser, and swtich stylesheets appropriately? Agh! You care causing yourself some *major* work that's absolutely unecessary. Plus, if someone comes to the site with javascript turned off, no stylesheet will be served.
What you *should* do is code the site for Mozilla, and use a conditional comment to serve up "fix it" code for IE. (EVen IE tells you this is the option they recommend). No need to create two full separate stylesheets - just do Mozilla, and IE will read it. Then it'll see the conditional comment fixes, and that will override for IE specs. No need to worry about javascript - and *definitely* cuts back on the amount of work you need to do.
That being said - I see what's up. The curvy at the top is the top section of the header, the green thing I'm seeing is the logo image, then those neat dotty things are below the logo image, then you have a wide space before the content begins. You're trying to place the navigation half over the "neat dotty things" and the wide blank space between the dotty things and content area.
Here is how I'm going to make your life easier. LOL
Okay, the "topHeader.png" img, logo image and the neat dotty things, as well as that kind of shaded area on the bottom half of your navigtion - just combine them all into one header image. If you need the logo to be "clickable" - that's easy enough to accomplish - but from the code I'm seeing, it doesn't look like it does. So just combine them all into one nice image. Set it as the background for your header. The put your navigational buttons within the header div, and position them with margins and such at the bottom, like so:
<div id=header">
<div id="nav">
nav links here
</div></div>
<div id="content">
blah blah blah...
Cleans up your code, solves your problem with layers and trying to split everything and show them between divs.
If you fear the header graphic would be too large in filesize, I would 1) recommend *not* using PNG - yes, the graphic turns out great, but the filesize is huge - just use JPG and compress it to your satisfaction; and/or 2) split it into two areas: headerTop and headerBottom. headerTop can be to top area and the logo, headerBottom can be all the stuff behind the navigational bar.
That would be the easiest and cleanest method to solve your problem - believe me.
And really - get rid of the javascript and go with conditional comments - it soooo makes your life a hell of a lot easier.
HTH!