Forum Moderators: mack

Message Too Old, No Replies

Text to download before Image

Text to download before Image

         

mavrick

9:14 am on Feb 18, 2004 (gmt 0)

10+ Year Member



Hi all

Small problem on a website i want the Text to download before an Image. Is there any way in code that i cn make this so. I heard if you included the height and width in the <img> tag, then the image will appear after the text.

Any ideas!

Thanks

ppg

9:33 am on Feb 19, 2004 (gmt 0)

10+ Year Member



If you use a css layout and put all your stuff in divs, the elements in your page will display in the browser in the order they come up in your code.

So you can put your text in a div at the top of your source and it will be displayed first. It also means that its the first thing a spider will see so its good from that point of view too.

grahamstewart

1:06 pm on Feb 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So you can put your text in a div at the top of your source and it will be displayed first.

Yuk - that also means you'll have to use absolute positioning and you page will look like hell if there is no CSS (or a user stylesheet).

mavrick you were on the right track - if you specify a width and height for all your images then the browser can get on with displaying the text without having to wait for the image to load.

However, not all browsers do things in the same order and things are often downloaded in parallel so if you have a small image and lots of text then the image may appear before ALL the text is loaded.

Can't see why this would cause a problem tho.

Oh.. by the way.. for some reason browsers tend to load background images last (i.e. images that were set using the CSS

background
property).