Forum Moderators: not2easy

Message Too Old, No Replies

Insertion of a menu makes other div sections disappear

possibly should be addressed in Flash forum?

         

lindseylicious

1:00 am on Feb 22, 2007 (gmt 0)

10+ Year Member



As with most of my problems, this one is probably BLATANTLY obvious to everyone else upon examining my code, but the solution is escaping me at the moment.

Basically what I have is a flash menu and HTML text. All the divs are working with my wrapper, background, and menu spacing etc, but this last div (mainpicture) is just totally kaput upon viewing the page.

HTML code:
<body>
<div id="main_wrapper">
<div id="main_block">
<div id="menu">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="650" height="27" id="menu" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="menu.swf" /><param name="quality" value="high"/>
<param name="bgcolor" value="#ffffff" /><embed src="menu.swf" quality="high" bgcolor="#ffffff" width="650" height="27" name="menu" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</div>
<div id="mainpicture">
hello
</div>

</div>
</div>

</body>

relevant CSS code:
#main_wrapper {
background-image: url('images/mainbg.jpg');
margin-top: 70px;
text-align: center;
height: 400px;
margin-left: 0px;
width: 100%;
}

#main_block {
top: 0px;
margin-left: auto;
margin-right: auto;
background-image: url('/images/brmainblock.gif');
height: 400px;
width:650px;
}

#menu {
position: relative;
top: 13px;
margin-left: auto;
margin-right: auto;
height: 27px;
width: 650px;
}

#mainpicture (
position: absolute;
background-color: #FFFFFF;
top: 200px;
left: 5px;
height: 310px;
width: 340px;
}

Suggestions, as always, graciously welcome. :)

[edited by: encyclo at 1:15 am (utc) on Feb. 22, 2007]
[edit reason] examplified, see forum charter [/edit]

encyclo

1:14 am on Feb 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The first (blatant ;)) problem I see with the markup is that you have two elements with the
id
"menu":

<[b]div id="menu"[/b]>
<[b]object[/b] classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="650" height="27" [b]id="menu"[/b] align="middle">

So with both the

div
and the
object
with the same
id
things are always going to get messy. :)

You should run your markup and CSS through the validator to fix these problems first, then once the page validates you can see if the bug still occurs.

HTML validator [validator.w3.org]
CSS validator [jigsaw.w3.org]

[edited by: encyclo at 1:15 am (utc) on Feb. 22, 2007]

lindseylicious

1:15 am on Feb 22, 2007 (gmt 0)

10+ Year Member



gorgeous, thank you! I will do just that and let you know how it goes.

lindseylicious

1:33 am on Feb 22, 2007 (gmt 0)

10+ Year Member



le sigh.

it's amazing what a little ( instead of an { can do.

encyclo

1:37 am on Feb 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah, I hadn't spotted that one. :) The validators should always be your first port of call when starting to debug, as at the very least you can be sure that it is not a code error which is causing the problem.