The Strict xhtml Document Type Definition states without ambiguity that the <object> element is an inline element, not a block element.
A block-level element is laid down on the page as if there was a linebreak before and after it. The <p> element is an example of a block element. Block-level elements pile up one on top of the other. Headlines, blockquotes, <div> tags, tables and lists are other examples of block-level elements. Inline elements don’t create a linebreak before or after them. They appear on the same line as content and elements beside them, they are inline with the text. They are laid next to one another horizontally, from left to right, until they fill the width of the container element, then they continue on, on the next line. That means that if you put two Flash objects side by side in the markup, they will end up side by side on the page if the width of the container (parent) element is large enough to accomodate their width.
While we’re at it, let’s list the five subsets of inline elements, as specified by the Strict xhtml DDT :
- First, there is the
%specialsubset : br, span, bdo, object, applet, img, map, iframe.- Then we have the presentational markup subset : tt (teletype), i, big, small, u, s, strike, font, basefont.
- Then we get the
phrase markupsubset : em, strong, dfn, code, q, sub, sup, samp, kbd, var, cite, abbr, acronym.- We also have the form markup subset : input, select, textarea, label, button.
- In the fifth subset, we have elements which, depending on their container element, are either inline or block elements : ins, del, script, noscript.
A question that we may ask ourselves is : can we put a Flash <object> inside an anchor element, to make it clickable, just like we can with text or an image ? The answer is yes, we can put an <object> element between <a> tags.
According to the Strict xhtml DDT :
- An anchor element cannot contain another anchor element.
- An anchor element can contain any other inline element (see list in the preceding box). The definition is clear : the child element of an anchor element can be an <object> element, as the object element is part of the %special inline subset.
If we do put a Flash object element inside an anchor element, will it be clickable, and will the browser load the page with the URL specified in the href
attribute... in the window ? The answer is yes in Firefox, and no in Internet Explorer. A quick and dirty way to circumvent the limitation (bug?) in Internet Explorer is to add a behavior to the Flash movie clip in the Flash Development Interface (do not bother writing ActionScript for this if the url is a constant) : the action would be Go to Web Page... and the event would be On Press. If you want to code it yourself, use the ActionScript function getURL(url:string, target:string). Use "_self"
as target if you want the browser to open the page in the current window.