HTML Help
HTML Help Central . com

» Online Users: 52

0 members and 52 guests
No Members online
Most users ever online was 695, 02-16-2011 at 08:01 AM.

» Site Navigation

 > FAQ

» Domains For Sale

Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2005
    Posts
    1

    CSS: Background Image in DIV

    I've fooled around with HTML a little bit before but I'd still consider myself a beginner. I just learned about CSS today and I'm trying to figure it out. I need 3 background images that are fixed and I learned that the only way to do this is to create some divisions and put background images into them. I've tried many times, but either the background image won't show up in my div or it overrides the main background I have set up for the webpage already (The main background image being my 1st image of 3, so trying to create 2 divisions for 2 addtional images)

    This is the general building block I'm working off of, though this isn't actually correct:

    <div>
    background-color:transparent;
    background-image:url(image.jpg);
    background-attachment: fixed;
    background-position:left center;
    background-repeat:no-repeat;
    </div>

    Can anyone give me a blueprint for a division with a background image in it that won't override the main background for the webpage itself?

    Thank You for any help.
    Last edited by mitoca; 11-15-2005 at 04:38 AM.

  2. #2
    Join Date
    Dec 2002
    Location
    Seattle, WA
    Posts
    1,306
    you can use classes to define the style of each "division", example
    Code:
    <!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>Untitled Document</title>
    <style type="text/css">
    <!--
    .unnamed1 {
    	/* CSS stuff here */
    }
    .unnamed2 {
    	/* CSS stuff here */
    }
    .unnamed3 {
    	/* CSS stuff here */
    }
    /* ... */
    -->
    </style>
    </head>
    <body>
    <div class="unnamed1">
      <div class="unnamed2">
        <div class="unnamed3">inner most div</div>
      </div>
    </div>
    </body>
    </html>
    if you can read and interpet manual jargun, this is a great source of info on css CSS 2.1

Similar Threads

  1. Image as background
    By qfullard in forum HTML / XHTML / XML
    Replies: 1
    Last Post: 04-01-2009, 11:27 AM
  2. Getting rid of background on image.
    By randomboy in forum Graphic Design
    Replies: 2
    Last Post: 09-24-2006, 03:41 PM
  3. CSS background image help?
    By vtecin in forum HTML / XHTML / XML
    Replies: 2
    Last Post: 12-11-2003, 11:57 AM
  4. Background Image
    By nangshu in forum HTML / XHTML / XML
    Replies: 1
    Last Post: 05-23-2002, 11:13 AM
  5. background image
    By Monique in forum HTML / XHTML / XML
    Replies: 1
    Last Post: 08-20-2001, 10:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBadvanced CMPS v4.1.1