Drop down menu hiding behind flash

Hello all.

I had a job interview yesterday and the man interviewing me was using IE7 when he checked out my website with me there and I almost blew a lid when my drop down menu wasn’t working properly.

Right now I’m at school using a computer with IE7 and am looking at it, and it looks like it’s because the drop down menu goes under the flash content, not necessarily that it’s not working. But I don’t know how to fix it:

Metal Gear Solid Walkthroughs

The links “walkthroughs” “videos” and “hints” have drop downs.

Please help me so I don’t run into this kind of embarressment again :frowning:

Thank you.

try addin the folowing to your flash embed:

<param name="wmode" value="transparent">

found on: http://css-tricks.com/snippets/html/keep-flash-behind-other-elements/

Ok it’s in their, but I don’t have IE7. I’ll let you know if it works (unless perhaps you have IE7 by any chance).

Hi,

It’s not working in IE7 - you need to add a z-index here to bring the menu in front:


.menu {
    position: relative;
    width: 960px;
    [B]z-index:999;[/B]
}


You also have problems with the drop down because of this corrupted rule here:


#nav-home ul ul a.drop, #nav ul ul a.drop:visited {
    background-color:#000000 right no-repeat;
}
[B]}
#nav a:hover {
    background-image:url(http://mgswalkthroughs.com/Images/Buttons/menubar.png);
}[/B]

Remove the stray bracket and the following rule.


[B]}
#nav a:hover {
    background-image:url(http://mgswalkthroughs.com/Images/Buttons/menubar.png);
}[/B]

You can’t do things like this:


<a href="index.php" class="home" title="home">
  <h1>Home</h1>
</a>

An anchor cannot contain a block element. Put the anchor inside the heading tag and then set the anchor to display:block.


<h1><a href="index.php" class="home" title="home">Home</a></h1>

However that should not be an h1 as you have used it many times and there should really only be one h1 per page in normal html. The h1 is the main page heading. Other headings should follow in a logical order at the correct level. Of course that is going to be very awkward to change because you have inter-weaved it all through that Conditional comments menu.

You would also nee to change the CC to target ie7 and above otherwise IE8 and 9 get the old style menu with the badly nested anchor and tables rules which they could decide are invalid and not apply.

It should be:


<!--[if gte IE 7]><!--></a><!--<![endif]-->

However, I dislike that menu (one of the few of Stus that I don’t like) because it is basically using invalid code but hiding it from the validator, and it also make the css and html more complex than necessary.

On a final note if I was thinking of employing you and then looked at your code and saw this:


</center>
 <!--- Yeah I'm using center tags. Shut up. -->

What do you think my reaction would be?

Would I say “here’s someone who cares about the work they’re doing” or would I think “Here’s someone who knows he’s done wrong but doesn’t care about it or me as he’s just told me to shut up!”.

While it may seem funny to write html comments like that it will often backfire on you so just don’t do it. (Especially when you are showing a future employer your work. :))

Hope that helps :slight_smile:

Install IETester. A bit buggy at times, but reasonably reliable when it comes to showing you what your site is going to look like in IE7.

Then again, if the person interviewing you for the job was using IE7, perhaps working there isn’t the best career move? :wink:

Then again, if the person interviewing you for the job was using IE7, perhaps working there isn’t the best career move?

Maybe they deliberately have that browser… just to test newbz!

Hehe. I would expect anyone who wanted to know if they could employ me to have looked at my examples in IE6… maybe even IE5. And Lynx. Or, I’d be a little surprised and maybe disappointed if they didn’t : )

Re Gar onn’s post… I vaguely recall there was something less browser-intensive than “transparent” for the window-mode… was it “opaque”? Both dealt with another Flash-vs-HTML bug, but one took more processing power to render or something. (Gary Turner knows, I learned it from him.)

[ot]
I woulda done it like this:


</center>
 <!--- Center tags give me superpowers -->

Because it’s more awesome.[/ot]

I’ll be sure to make those changes, Paul. Lol especially with the comment. Thank you for your comment.

Thank you for the link.

In a way, I think you could be right. He probably knew that IE7 is a crappy browser and he was checking to see if I paid attention to that.

Maybe I will use a comment like that lol. I kind of put it there in a way, as saying that I’m aware that <center> tags are sort of frowned upon while adding some humor. Lol I’ll take out the shut up part.

I kind of put it there in a way, as saying that I’m aware that <center> tags are sort of frowned upon while adding some humor.

Humour is great, but the problem here is, it would be hard to tell if you knew what you could do to make it valid.

Unless there were other versions that validated to compare to.

So then how would I go about making it valid? I tried making a separate div and also tried putting it in a p-class that would center it, but both put a small gap in between the picture and the news, which I don’t want.

Hi,

The latest heading looks like a heading :slight_smile: and should be a heading tag.

e.g.


<h3 class="latest"><a href="category/news.php"><img height="25" width="205" src="Images/Buttons/latest.jpg"></a></h3>


h3.latest {
    margin:0;
    padding:0;
    text-align:center;
}

If you use a p element or similar then remove the default margins to close the gap.

To enclose blocks of content use a div with a width and use margin:auto to center the whole block.

I thank you, once again. It did absolutely nothing to my latest heading, but is now in a way that is technically correct. Thank you, God.

Oh no oh no…

Paul, shame on you! :frowning:

<h3 class=“latest”><a href=“category/news.php”><img height=“25” width=“205” src=“Images/Buttons/latest.jpg” alt=“Latest”></a></h3>

@louie you can never rely on images loading, or being seen.

For centering stuff, just remember the fairly-easy rules which should get you through most centering needs:

Inline elements (includes images and anchors) can be centered if their parent element (who must be a block) has text-align: center on it.

Block elements who contain inline stuff like plain text (like h1-6, p, OR an inline who’s been set to display: block or any other block context) can have that inline content centered by setting text-align: center on it.
(this is the one Paul recommended. It means the h3 is not centered; being a block element without a width, it’s automatically 100% wide anyway. But the inlines inside should be centered, so long as they weren’t set to block context anywhere)

Block elements who themselves need to be centered, like div containers etc, need (can be %, em, px, whatever… cannot be “auto”)
-a non-100% wide width set
-automargins (sides work only)
-they must be a non-floated block element!
-they must not be position-absolute or position-fixed

Yes sorry, I rushed that answer a bit and missed that the alt attribute was missing in the OP’s code.:frowning: Usually I would use an image replacement for images that are headings but I guess I was just too lazy with my answer.

I just assumed an 8 year SitePoint veteran with 33k posts probably had the best answer. Boy was I WRONG! (lol jk… kinda) :slight_smile:

Ha ha - we all make mistakes :slight_smile: (Mind you the mistake was yours first as I just copied your image tag - my mistake was not noticing your mistake (:slight_smile:

Oh, sure, try to blame the victim! :smiley:

You noticed that then :blush:

Lol it’s all good guys. At least my drop down menu works in IE7 now (though I still need to get around to the lame <h1> tags). Next time I’ll try not to dress provocatively use stupid code, I know it’s all my fault.

It’s good to be backward compatible, but it doesn’t work consistently on FF on a mac either…

I have seen this question in the forum before. I think the chief bug is in Flash itself ( and am not just talking about how bad an idea it is to use flash for navigation).By the way it’s failing in FF I could guess that it is a redraw issue.

To help you with your “don’t let me make this mistake again”… I’m going to go through your page and give you a nice itemized list of the problems. This may re-iterate some of the above mentioned issues.

Warning, I’m very blunt – think of me as the Gordon Ramsey of web design.

First a simple content review.

  1. Your content size without images/objects is larger than I’d expect the entire page (HTML+CSS+IMAGES+OBJECT+SCRIPTS) to be on such a simple layout.

  2. With images it’s three times the upper limit I’d allow on a page.

  3. You’ve got 1.7k of plaintext and seven content objects/images – so what exactly is that 11k of HTML doing? Given how little is on the page I’d say at least a quarter of your markup is bloat.

  4. You want to impress people? Do not declare your fonts in your content areas in px, do not use color combinations that are effectively illegible to more than half the population (cyan on grey, grey on grey, etc, etc). You may want to research this thing called the “Web Content Accessibility Guidelines” – or pick up a copy of the old joint IBM/M$/Apple user interface guidelines. (though it’s been two decades since that was commonly available anywhere).

  5. Your problem is flash – for some stupid animooted nonsense at the top of the page that’s more annoyance than useful. My advice, LOSE THE FLASH. Flash should be reserved for playing actual videos or embedding flash games, not for some stupid banner. You can file that right alongside auto-playing MIDI music, comic sans, and animated gif backgrounds.

  6. No potential employer that actually knows anything about web devlelopment is going to be impressed with 42 validation errors. That means you don’t have HTML, you have gibberish.

… and that’s before we dig into the code. From a code perspective:

  1. You might want to try writing using a MODERN RECOMMENDATION doctype, like XHTML 1.0 STRICT or HTML 4.01 STRICT instead of broadcasting to the world you are still in transition from 1997 to 1998. You’re not Quagmire, so you shouldn’t be caring if that tranny is pre or post-op.

  2. You MAY wish to follow the rules of XHTML when using a XHTML doctype and actually bother CLOSING your tags and typing all your tags and attributes in lower case.

  3. You may wish to consider kicking dreamweaver’s templating system to the curb, it causes more problems than it solves.

  4. Your IE7 CC makes no sense since it’s closing an anchor that doesn’t even exist at that point in the code.

  5. You should probably learn about CSS “media” types and bother using the MEDIA attribute in your markup.

  6. You should learn what heading tags are and when/how to use them. Things like “you shouldn’t have more than one” – things like “a menu item is NOT the start of a content subsection, so why do you even have heading tags there?”… things like “don’t skip over numbers going down”. Lower order (higher numbered) heading tags in HTML 4/earlier (and by extension XHTML 1.0) mean "start of a subsection of the higher order (lower numbered) tag preceeding it… so if you have a H3 without a H2 before it, that makes NO SENSE… and if you made that first H3 a h2 so it made sense, you’d be saying it’s a subsection of “Downloads” – which would also make no sense.

  7. The Title attribute should be used when you can’t fit meaningful text into your anchors, which typically means that if you have to use a title attribute, there’s something WRONG with the content of your menu anchors.

  8. You’re using faulty image replacement techniques that don’t actually work for users browsing with images off… at which point why bother?

  9. Tables for layout, what is this 2001? ESPECIALLY with the one TD for a table…

  10. outdated attributes that have no business in modern markup – like ALIGN, HSPACE, etc… wow, and you used the CENTER tag too. That’s how you end up with the “what is this 1997” comment out of seasoned developers.

  11. Id’s are supposed to be unique, as such you shouldn’t be trying to use them more than once. (@pNews for example)…

  12. You seem to be including javascript for flash, but then have the non-scripted flash embed in use… If you’re gonna build a flashtard layout, pick one, not both.

  13. Ah, that silly IE conditional table for a menu nonsense. Do yourself a favor, pitch that in the trash, build a normal CSS menu and then throw a behavior file at IE6- instead of wasting every browsers time on that extra markup regardless of if it’s being used or not.

  14. Learn how to use the paragraph tag too. IF you use a double break inside a paragraph, you may have missed the point. If you have to say "align=“left” on each one of them, you may be relying on the WYSIWYG part of that dung-heap known as Dreamweaver.

  15. You have overstuffed your keywords meta to the point it WILL be ignored. Most people think keywords is ignored anyways but if you limit yourself to 8 to 10 SINGLE WORDS that are repeated in the body of the document, keeping the total character count under 128 characters without saying the same words over and over again, it actually still makes an impact in Google and Bing. If the words used in it do not appear in your body text, you’ve missed the point of the tag.

Also, it’s called keywords, not keyphrases. Think of it as a word jumble – you don’t have to say "metal gear solid fill_in_the_blank twenty times. “metal, gear, solid” covers a third of what you lather, rinse, repeated.

  1. Ease up on the div and classes. To quote Carlin “Not every ejaculation deserves a name” – or in your case not every tag needs a DIV around it or a class/ID on it. See #nav for example; UL is a perfectly good block level container.

  2. I’d axe a lot of that scripting that doesn’t seem to be doing any… oh wait, that’s for an advert that isn’t actually showing here.

If I was writing that same basic page layout retaining the silly flash bits, the code would probably have ended up looking something like this:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	lang="en"
	xml:lang="en"
><head>

<meta
	http-equiv="Content-Type"
	content="text/html; charset=utf-8"
/>

<meta
	http-equiv="Content-Language"
	content="en"
/>

<meta
	name="Description"
	content="Metal Gear Solid Walkthroughs. Articles, Videos, Easter Eggs, etc. Our walkthroughs are very detailed and even include information on the number of guards, where items are located, etc."
/>

<meta
	name="Keywords"
	content="metal,gear,solid,walkthroughs,hints,guides,videos,tutorials,maps,help,community"
/>

<link
	type="text/css"
	rel="stylesheet"
	href="screen.css"
	media="screen,projection,tv"
/>

<link
	rel="shortcut icon"
	href="images/other images/more/favicon.ico"
/>

<title>
	Metal Gear Solid Walkthroughs
</title>

</head><body>

<div id="pageWrapper">
	<h1>
		<a href="\\">
			Metal Gear Solid Information
			<span></span>
		</a>
	</h1>

	<ul id="mainMenu>
		<li>
			<a href="index.php">Home</a>
		</li><li>
			<a href="category/news.php">News</a>
		</li><li>
			<a href="#">Walkthroughs</a>
			<ul>
				<li><a href="metalgearsolid/mgs1/intro.html">MGS1 Walkthroughs</a></li>
				<li><a href="metalgearsolid/mgs2/intro.html">MGS2 Walkthroughs</a></li>
				<li><a href="metalgearsolid/mgs3/intro.html">MGS3 Walkthroughs</a></li>
				<li><a href="metalgearsolid/mgs4/intro.html">MGS4 Walkthroughs</a></li>
			</ul>
		</li><li>
			<a href="#">Videos</a>
			<ul>
				<li><a href="metalgearsolid/mgs1/more/video.html">MGS1 Videos</a></li>
				<li><a href="metalgearsolid/mgs2/more/video.html">MGS2 Videos</a></li>
				<li><a href="metalgearsolid/mgs3/more/video.html">MGS3 Videos</a></li>
				<li><a href="metalgearsolid/mgs4/more/video.html">MGS4 Videos</a></li>
			</ul>
		</li><li>
			<a href="#">Hints</a>
			<ul>
				<li><a href="metalgearsolid/mgs1/more/hints.html">MGS1 Hints</a></li>
				<li><a href="metalgearsolid/mgs2/more/hints.html">MGS2 Hints</a></li>
				<li><a href="metalgearsolid/mgs3/more/hints.html">MGS3 Hints</a></li>
				<li><a href="metalgearsolid/mgs4/more/hints.html">MGS4 Hints</a></li>
			</ul>
		</li><li>
			<a href="downloads/downloads.php">Downloads</a>
		</li><li class="last">
			<a href="category/search.html">Search</a>
		</li>
	</ul>

	<div id="columnWrapper">

		<div id="contentWrapper"><div id="content">

			<!--[if IE]>
			<object
				classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
				width="720" height="213"
				id="homeFlash"
			>
			<![endif]-->
			<!--[if !IE]>-->
				<object
					data="Flash/mgsslide.swf"
					type="application/x-shockwave-flash"
					width="720" height="213"
				>
			<!--<![endif]-->
				<param name="movie" value="Flash/mgsslide.swf" />
				<param name="quality" value="high" />
				<param name="swfversion" value="6.0.65.0" />
				<param name="wmode" value="transparent">
				<param name="autoplay" value="true" />
				<p>
					Content on this page requires a newer version of Adobe Flash Player.
				</p>
				<a href="http://www.adobe.com/go/getflashplayer">
					<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
						alt="Get Adobe Flash player"
						width="112" height="33"
					/>
				</a>
			</object>

			<ul class="pairButtons">
				<li class="comment">
					<a href="category/comment.php">
						<strong>Comment<span><!-- image replatement --></span></strong><br />
						Leave feedback for this site
					</a>
				</li>
				<li class="affiliate">
					<a href="category/affiliate.html">
						<strong>Affiliate<span><!-- image replacement --></span></strong><br />
						Check out these other sites or submit your own
					</a>
				</li>
			</ul>

			<div class="newsItem">
				<h2>
					<a href="category/newsarticle.php?record=14">
						Snake Eater 3DS - This Winter
					</a><br />
					<small>Posted on: June 9, 2011</small>
				</h2>
				<img
					src="http://desmond.imageshack.us/Himg819/scaled.php?server=819&filename=3dsp.jpg&res=gal"
					class="leadingPlate"
				/>
				<p>
					Metal Gear Solid 3: Snake Eater, will be released to the portable Nintendo 3DS this winter recognized as Snake Eater 3DS.
				</p>
				<a href="category/newsarticle.php?record=14" class="read more">
					Read More
					<span><!-- image replacement --></span>
				</a>
			<!-- .newsItem --></div>

			<div class="newsItem">
				<h2>
					<a href="category/newsarticle.php?record=8">
						Metal Gear Solid HD coming to PS3!
					</a><br />
					<small>Posted on: June 8th, 2011</small>
				</h2>
				<img
					src="http://img710.imageshack.us/img710/5066/mgshd.jpg"
					class="leadingPlate"
				/>
				<p>
					The Metal Gear Solid Trilogy will be coming to the PS3 in HD, including the PSP game Peace Walker.
				</p>
				<a href="category/newsarticle.php?record=8" class="readMore">
					Read More
					<span><!-- image replacement --></span>
				</a>
			<!-- .newsItem --></div>

			<div class="siteInfo">
				<h2>Site Information</h2>
				<img
					src="Images/Other Images/Mgs2 Photos/m2 Soldier.png"
					width="273" height="175"
					alt="MGS2 Russian Soldier"
					class="trailingPlate"
				/>
				<p>
					<b>June 8th, 2011</b>: There's going to be some changes around here. Instead of a walk throughs only site, this will now be a news site too. Please don't mind the clutter, there is going to be construction over the next few days (or weeks).
				</p><p>
					<b>June 3rd, 2011</b>: Something terrible has happened to the comment box and has stopped working. It will be undergoing maintenance, however some of the comments may be lost.
				</p><p>
					Update: The comment box is now updated and functioning properly.
				</p>
			<!-- .siteInfo --></div>

			<a href="category/newsarchive.php" class="archiveLink">
				Old News
			</a>

		<!-- #content, #contentWrapper --></div>

		<div id="sideBar">

			<div id="latestSummaries">
				<h2>
					<a href="category/news.php">
						Latest
						<span><!-- image replacement --></span>
					</a>
				</h2>
				<ul>
					<li>
						<a href="category/newsarticle.php?record=14">
							Snake Eater 3DS - This Winter
						</a>
					</li><li>
						<a href="category/newsarticle.php?record=8">
							Metal Gear Solid HD coming to PS3!
						</a>
					</li><li class="last">
						<a href="category/newsarticle.php?record=6">
							Kojima Not Attending E3
						</a>
					</li>
				</ul>
			<!-- #latestSummaries --></div>

			<div class="subSection">
				<a href="http://www.youtube.com/louie540x">
					<img src="Images/Buttons/yt.jpg" alt="Youtube Channel" />
				</a>
			<!-- .subSection --><?div>

			<div class="subSection">
				<a href="category/contact.php">
					<img src="Images/Buttons/donate.jpg" alt="Donate to this site" />
				</a>
			<!-- .subSection --><?div>

		</div>

	<!-- #columnWrapper --></div>

	<div id="footer">
		<ul>
			<li><a href="index.html">Home</a></li>
			<li><a href="category/sitemap.html">Site Map</a></li>
			<li><a href="category/affiliate.html">Affiliate</a></li>
			<li><a href="category/contact.php">Contact</a></li>
			<li><a href="category/legal.html">Privacy Policy</a></li>
		</ul>
	<!-- #footer --></div>

<!-- #pageWrapper --></div>

</body></html>

Though again I’d swing an axe at the flash bit. I’d also consider stripping out most of the image replacements to either live with actual TEXT in those locations, or give CSS3 webfonts a good hard look. (though the filesizes could be a deal-breaker there).

Everything else you’re trying to do on that page belongs in your CSS.