Click to See Complete Forum and Search --> : background help please
cupofjoe
02-24-2005, 10:41 PM
ok im having a serious brain fart right now...
<body background="back2.gif" style="fixed">
this is my background... is there a way to center it?
_Aerospace_Eng_
02-24-2005, 11:00 PM
if you are going to use some type of css, then y not use it for all of the body tag? anyways style="fixed" is not valid but this is
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Background Centered</title>
<style type="text/css"><!--
html,body {
background-image:url(back2.gif);
background-attachment:fixed;
background-position:center;
/*shorthand version below*/
/*background:url(back2.gif) fixed center;*/
/*for no repeat*/
/*background:url(back2.gif) no-repeat fixed center;*/
}
-->
</style>
</head>
<body>
content here
</body>
</html>
ray326
02-24-2005, 11:03 PM
You'll need to do it with CSS.
http://www.w3.org/TR/REC-CSS1#background-position
cupofjoe
02-25-2005, 05:17 AM
i tried to do it with css, but for some reason the background didnt show up in mozilla
Don't do this (in strict mode), you are placing two images on the background.
html,body {
background-image:url(back2.gif);
There are stacked on top of each other.
html, body {
height:100%;
}
html {
background:transparent url(Image.gif)no-repeat;
}
body {
background:transparent url(Image.gif) center no-repeat;
}
The two are only visible in Moz. and Opera no IE
cupofjoe
02-25-2005, 10:45 AM
thanks fang, but i'm looking for something that is friendly to all browsers
body {
background:url(Image.gif) center no-repeat;
}
cupofjoe
02-25-2005, 08:59 PM
the website I made is here (http://www.iflta.org). On mozilla, the background doesnt show, but on IE it does
ray326
02-25-2005, 11:39 PM
background: url("back2.gif") repeat fixed center Missing a ";" at the end of the style and you can drop the quotes around the file name.
cupofjoe
02-26-2005, 10:25 AM
gosh why didn't I see that
thanks a lot:D
ray326
02-26-2005, 03:11 PM
That's why paired programming works.