Forums

Preload image in a div background with css?? (6 posts)

  1. pavlos1982
    Member
    Posted 2 years ago #

    im having some problem when load my template that my header image get load last i want to find a way css preferably so it can be loaded first and i can select what i want to load first this is my website http://webdeveloper.byethost11.com/

    thanks

  2. Steffen Jørgensen
    Member
    Posted 2 years ago #

    The image gets loaded first, but it is about 70kb so it takes a little while to load (everything else is about 4.5kb all together)

    Downsize the image to about 10-20kb and it will load faster.

  3. pavlos1982
    Member
    Posted 2 years ago #

    i have already optimized the image has much has i can i think if i try to optimized it more i will loose the quality ?? any more ideas, i have heard something about using css for image preloading ?? know anything about that??

    or is there any tool i could optimized the image without loosing quality?

  4. MindBlender 3D
    Member
    Posted 2 years ago #

    I've heard of Javascript being used to preload images.
    In all the applications I've seen, the image is something like a button, or something that is not supposed to be visible when the page loads normally.

    Of course, I will be the first to say that my Javascript knowledge comes nowhere close to mastery. That said, it is entirely possible that there may be a Javascript trick you can use to make sure your header gets loaded first.

    In any event, you will need a programming language (like PHP or Javascript) to make a command like that, versus a styling language (like XHTML or CSS) which does nothing more than tell the user's browser how to present your content.

    Hope this info is useful to you!

    --MindBlender 3D

  5. pavlos1982
    Member
    Posted 2 years ago #

    i want to use this technique with css but im not sure its working basically this is my header tag:

    <div id="header">
    <div id="wrapper2">
    <ul class="menu">
    <?php echo preg_replace('@\<li([^>]*)>\<a([^>]*)>(.*?)\<\/a>@i', '<li$1><a$2><span>$3</span>', wp_list_pages('echo=0&orderby=name&exlude=181&title_li=&depth=1')); ?></div></div>

    and i want to add a css to it so it preload a background image into this header tag , javascrip is good but they saying css is better because some people has javascript blocked on their browser so an issue there if i can get the css way to work then brilliant

  6. pavlos1982
    Member
    Posted 2 years ago #

    this is the website i found which you suppose to be able to preload with just css :

    perishablepress.com

    but im not sure wether its working or not

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.