HTML, XHTML and CSS All-In-One for Dummies - Andy Harris [106]
♦ Content issues: If you create all the text in your graphic editor, it isn’t really stored to the Web page as text. In fact, the Web page will have no text at all. This means that search engines can’t index your page, and screen-readers for people with disabilities won’t work.
♦ Difficult updating: If you find an error on your page, you have to modify the image, not just a piece of text. This makes updating your page more challenging than it would be with a plain XHTML document.
♦ File size issues: An image large enough to fill a modern browser window will be extremely large and slow to download. Using this technique will all but eliminate users with dialup access from using your site.
Problems with Flash
Another tool that’s gained great popularity is the Flash animation tool from Adobe (formerly Macromedia). This tool allows great flexibility in how you position things on a page and supports techniques that are difficult or impossible in ordinary HTML, such as sound and video integration, automatic motion tweening, and path-based animation. Flash certainly has a place in Web development (especially for embedded games — check out my earlier book, Beginning Flash Game Programming For Dummies). Even though Flash has great possibilities, you should avoid its use for ordinary Web development for the following reasons:
♦ Cost: The Flash editor isn’t cheap, and it doesn’t look like it’ll get cheaper. The tool is great, but if free or low-cost alternatives work just as well, it’s hard to justify the cost.
♦ Binary encoding: All text in a Flash Web page is stored in the Flash file itself. It’s not visible to the browser. Flash pages (like image-based pages) don’t work in Web searches and aren’t useful for people with screen-readers.
♦ Updating issues: If you need to change your Flash-based page, you need the Flash editor installed. This can make it more difficult to keep your page up to date.
♦ No separation of content: As far as the browser is concerned, there’s no content but the Flash element, so there’s absolutely no separation of content and layout. If you want to make a change, you have to change the Flash application.
♦ Search engine problems: Code written in Flash can’t always be read by search engines (though Google is working on the problem).
♦ Technical issues: Flash is not integrated directly into the browser, which leads to a number of small complications. The Forward and Back buttons don’t work as expected, printing can be problematic, and support is not universal.
Adobe has recently released a very interesting tool called Flex. It’s based on the Flash engine, and it’s specifically designed to overcome some of the shortcomings I list here. It’ll be interesting to see if this becomes an important technology. Advances in HTML 5 and CSS3 also show some promise, so perhaps Flash will become less necessary.
Introducing the Floating Layout Mechanism
CSS supplies a couple techniques for layout. The preferred technique for most applications is a floating layout. The basic idea of this technique is to leave the XHTML layout as simple as possible but to provide style hints that tell the various elements how to interact with each other on the screen.
In a floating layout, you don’t legislate exactly where everything will go. Instead, you provide hints and let the browser manage things for you. This ensures flexibility because the browser will try to follow your intentions, no matter what size or shape the browser window becomes. If the user resizes the browser, the page will flex to fit to the new size and shape, if possible.
Floating layouts typically involve less code than other kinds of layouts because only a few elements need specialized CSS. In most of the other layout techniques, you need to provide CSS for every single element to make things work as you expect.