Solved

Background first?

Posted on 1998-07-21
4
144 Views
Last Modified: 2010-04-09
I need to load a background before the text...Is this possible or is there a work-around? Also, (of course) I need it to load quickly.
0
Comment
Question by:davisja
4 Comments
 
LVL 2

Expert Comment

by:SirCaleb
ID: 1844795
What is the size of the image...?k
Also, what is the pixel dimensions...width and height
0
 
LVL 12

Accepted Solution

by:
Otta earned 100 total points
ID: 1844796
> I need to load a background before the text..
> Is this possible?

No. The HTML (Hyper Text Markup Language)
does not allow you to specify the "order" of loading;
it only defines the "final-view".

So, a tag like:

   <body bgcolor="#ffffff" text="#000000"
       link="#000080" vlink="#800040" >

defines a "white" background, with "black" text,
and "blue" links, and "red" visited-links.

> Also, (of course) I need it to load quickly.

Using a "solid-colour" background is much faster
than loading a "background-image".
0
 
LVL 3

Expert Comment

by:bigelos
ID: 1844797
Actually, you might be able to "load" the text after the background using JavaScript.

Here is a little sample - not yet tested, so consider it as pseudo-code.  My connection is too fast to test it - everything appears almost instantly.  At any rate...

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
// Here is where you would put your actual HTML.
// It won't be run until the entire file is loaded.
function write_txt(){
    document.write('Write this text');
    document.write('<center><b>Write this other text in bold, centered </b></center>');
}
</SCRIPT>
</HEAD>
<BODY background="your_image.jpg" onload="write_txt()">
</body>
</html>
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1844798
I think a nice way around avoiding text which doesn't read well on white because a background image is used is using BOTH the bgcolor and background attributes of the body tag.  Because like otta said, background colors load quickly, so your color will load quickliy making the text at least readable while a background image is being loaded.  Of course picking a color close to the images color is a good idea too.

Hope this helps,
Josh
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Pass form variable from one web form to another 2 29
tiny glitch in my main slider 3 38
Html form and modal / img src -problem 3 29
Set time on Session (ASP) 14 22
This article discusses four methods for overlaying images in a container on a web page
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question