Solved

backgrounds

Posted on 2002-03-27
5
251 Views
Last Modified: 2010-04-09
hi, im making a website and i want to have a background picture on a page but i dont want it repeated throughout the whole page, how do i do this? :)
0
Comment
Question by:wolfdood
  • 3
  • 2
5 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 50 total points
ID: 6899996
This is an IE (and Netscape 6) only method of having a "no-tile" background.
Because it uses no-repeat image won't scroll with the page.
Just like the effect of BGPROPERTIES="fixed"

<HTML>
<HEAD>
   <TITLE> Fixed background using styles <TITLE>
<STYLE TYPE="text/css">
   BODY { background-repeat:no-repeat;background-attachment:fixed;
          background-position:left top;background-image:url(blah.jpg) }
</STYLE>
</HEAD>
<BODY>
etc...

The background-position can left/center/right for x axis and
top/center/bottom for the y axis.  With IE5.5 you can use a numeric value to
specify the x/y co-ordinates in pixels      

=====================================================      

cross-browser ???

<HTML>
<HEAD>
<STYLE TYPE="text/css">
   #bgID { position:absolute;top:xxx;left:yyy;z-index:1 }
</STYLE>
</HEAD>
<BODY>
   <!-- page stuff -->

   <DIV ID="bgID">
      <IMG SRC="blah.jpg">
   </DIV>
</BODY>  
</HTML>

The z-index value can be a problem.  Netscape does not accept a
negative value so other elements must be 2 or higher.

Cd&
0
 

Author Comment

by:wolfdood
ID: 6900022
i tried the first way of doing it but i cant get my background to show. the pic im using for the background is in the same folder for the wedsite and is called background.png     do i need to specify its full path? thanx.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6900060
I did't think you deeded full path, but you can try it.  Also do not put quotes around it, and make sure of the spelling some hosting services are case sensitive.

Cd&
0
 

Author Comment

by:wolfdood
ID: 6900083
ta very much!!! :)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6900111
Glad I could help.  Thanks for the A. :^)

Cd&
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now