Click to See Complete Forum and Search --> : I THINK I'M DUMB :confused:


jeff_archer7
11-19-2003, 05:42 PM
Why Does This Not Work Trying To Do the static background thing :confused:


<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<style type="text/css">
<body
background-image:url(file:///C|/Documents and Settings/Jeff Archer/My Documents/My Pictures/B&W Congo Flag.jpg);
background-repeat:repeat;
background-attachment:fixed;
background-position:top
>
</style>

</html> :confused:

Paul Jr
11-19-2003, 05:55 PM
<style type="text/css">
body {
background-image:url(file:///C|/Documents and Settings/Jeff Archer/My Documents/My Pictures/B&W Congo Flag.jpg);
background-repeat:repeat;
background-attachment:fixed;
background-position:top;
}
</style>


You had it enclosed with "<" and ">", which is not needed, and you left out the "{" and "}". Try this here.

***EDIT***

This can also be written out in shorthand, like so:

body {
background:url(file:///C|/Documents and Settings/Jeff Archer/My Documents/My Pictures/B&W Congo Flag.jpg) repeat fixed top;
}

As I recall...

Charles
11-19-2003, 05:57 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-au">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Style-Type" content="text/css">
<title>Example</title>

<style type="text/css">
<!--
body {
background-image:url(file:///C|/Documents and Settings/Jeff Archer/My Documents/My Pictures/B&W Congo Flag.jpg);
background-repeat:repeat;
background-attachment:fixed;
background-position:top;
}
-->
</style>
</head>

<body>

</body>
</html>

Charles
11-19-2003, 06:00 PM
Originally posted by Paul Jr
As I recall... There's no need to recall. Just see http://www.w3.org/TR/REC-CSS2/colors.html#q2.

jeff_archer7
11-19-2003, 07:26 PM
Dear All

Tried many different options but I think this one is the easiest
WHAT DO YOU THINK..... Do you forsee any probs with this method

<HTML>
<HEAD>
<TITLE>STATIC BABY</TITLE>
</HEAD>
<BODY>
<P align=center>
<SCRIPT language=JavaScript1.2>
if (document.all)
document.body.style.cssText="background:white url( WHATEVER IT IS.jpg ) no-repeat fixed center center"
</SCRIPT>
</P>
<h1>&nbsp;</h1>
</BODY>
</HTML>

Let me know:cool:

Charles
11-19-2003, 08:06 PM
Originally posted by jeff_archer7
WHAT DO YOU THINK1) Your HTML is invaled.

2) The "language" attribute was depricated in favor of "type" way back in 1997.

3) You are using JavaScript to set a style. That eliminates 13% of users right there.

4) You are using a non-standard document object model. That eliminates another chunk of users.

5) There's a perfectly good syntax for specifying your styles and it's been around since 1996. Use it.

jeff_archer7
11-19-2003, 08:25 PM
I dont understand some of what you said

I'm new at this
and I'm old

your comment WAY BACK IN 97" doesn't seem that long ago to me
I have tried other options

How is the standard syntax worded

I deleted 'language' and put in 'type'

my code is now

<HTML>
<HEAD>
<TITLE>STATIC BABY</TITLE>
</HEAD>
<BODY>
<P align=center> <b>
<SCRIPT type=JavaScript1.2>
if (document.all)
document.body.style.cssText="background:#99CCFF url(file:///C|/Documents and Settings/Jeff Archer/My Documents/My Pictures/EAGLE AUS.jpg) no-repeat fixed center center"
</SCRIPT>
</b></P>

IS THIS BETTER

pyro
11-19-2003, 09:12 PM
Originally posted by jeff_archer7
your comment WAY BACK IN 97" doesn't seem that long ago to me...In computer years, it is ancient...

Take a look at the CSS solutions provided above - that is what you want to use.

spufi
11-20-2003, 12:14 AM
"background-image:url(file:///C|/Documents and Settings/Jeff Archer/My Documents/My Pictures/B&W Congo Flag.jpg);"

I just want to mention that even if this code works, it's far from ideal. Why? If you ever have to upload this to a server online, the path will instantly be invalid. Plus, it's super long and spaces and a & character makes the path look rather funky. What you should do is create a folrder to have all of your web page files in. Within that file, create a file where you only put your images. Your CSS becomes something like this.

background-image:url(images/bwcongoflag.jpg);

A lot nicer to look at isn't it? Just make sure you have a images folder on your server in the root directory and place the needed image in it and you won't have to change a thing between testing it on your PC and having it go online.