Solved

Background first?

Posted on 1998-07-21
4
145 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
dynamic created check uncheck boxes 6 43
HTML5 storage and web apps 11 55
output in HTML in Powershell 5 29
CSS for Popup in ASP.NET 4 22
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

696 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