Solved

backgrounds

Posted on 2002-03-27
5
258 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CSS grid style change 2 33
Bootstrap 3 icons 3 39
Bootstrap 3 with accordion menu 2 44
How can I   ajax html table  rows? 20 60
Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

929 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

11 Experts available now in Live!

Get 1:1 Help Now