views:

283

answers:

3

See the code below:

<div>Lorem ipsum dolor sit amet</div>  
    <object  
        type="application/x-shockwave-flash"  
        data="banner.swf"  
        width="965"  
        height="120"  
    ></object>  
<div>Consectetur adipiscing elit</div>

Viewing it in either Gecko, Webkit or Presto, an unintentional vertical space occurs after the object, before the second div (see http://jooadam.hu/object). Removing whitespace from between tags, or explicitly setting margin and padding does not help.

Any help would be appreciated.

A: 
<div>Lorem ipsum dolor sit amet</div>
<object width="965" height="120">
    <embed src="banner.swf" type="application/x-shockwave-flash" width="965" height="120"></embed>

Lorem ipsum dolor sit amet

Kieran
but really to put flash on your page you should use something like http://code.google.com/p/swfobject/
Kieran
Embed is a proprietary element and therefore not part of the HTML specification.
Joó Ádám
A: 

This problem really got me curious, besides the fact that I would use a different approach like using SWF object, the whitespace seemed to come out of nowhere.

I fiddled around a bit with firebug and found a way to fix it by just adjusting the styles:

#container { line-height: 0;}
#header, #footer { line-height: 1em;}

However I suspect that if you add a around the object tag it should fix itself.

Les
A: 

In the meantime someone answered my quoestion on another forum. Objects, like images are inline-block elements; setting display: block on object solves the problem.

Joó Ádám