It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

Div Images

Div Images

Postby CourteousCat on Sat Mar 24, 2007 12:38 am

I was wondering if there is any way to get a div to have a background image.

Thanks in advance for you're help!
Last edited by CourteousCat on Sat Mar 24, 2007 2:11 pm, edited 1 time in total.
CourteousCat
 
Posts: 11
Joined: Sun Mar 04, 2007 10:48 pm

Postby generalchaos316 on Sat Mar 24, 2007 4:54 am

You should be able to nest your divs inside eachother.
Code: Select all
<div background stuff>
     <div pretty picture>
          <div text>
          </div>
     </div>
</div>
generalchaos316
100+ Club
 
Posts: 101
Joined: Fri Mar 16, 2007 6:01 am

Postby CourteousCat on Sat Mar 24, 2007 2:11 pm

Well I'm asking how to put a div background image...
thanks anyway!
CourteousCat
 
Posts: 11
Joined: Sun Mar 04, 2007 10:48 pm

Postby generalchaos316 on Sat Mar 24, 2007 4:04 pm

I guess I don't understand what you are detailing. Can you create a illustration of some sort and post it?
generalchaos316
100+ Club
 
Posts: 101
Joined: Fri Mar 16, 2007 6:01 am

Postby CourteousCat on Sat Mar 24, 2007 8:52 pm

...i mean i want to know how to put an image as a div's background that doesn't repeat.
CourteousCat
 
Posts: 11
Joined: Sun Mar 04, 2007 10:48 pm

Postby generalchaos316 on Mon Mar 26, 2007 3:35 pm

Ah, ok...I get it now. You will need to use CSS to do this if you are not already. In your HTML code do this:

Code: Select all
<div id="myDiv">
   content goes here
</div>


And in your CSS file:

Code: Select all
#myDiv {
   background: url(pathToYourImage) no-repeat;
}
generalchaos316
100+ Club
 
Posts: 101
Joined: Fri Mar 16, 2007 6:01 am

Postby C@L on Mon Mar 26, 2007 5:47 pm

or
<div style="background: url(yourURL.gif) no-repeat;">
.....C o n t e n t.....
</div>


If you dont have a CSS file =]
Image
User avatar
C@L
250+ Club
 
Posts: 445
Joined: Fri May 13, 2005 6:36 pm
Location: Lpool, England


Who is online

Users browsing this forum: No registered users and 5 guests