Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS expand box with image

    Is it possible to set a background image and have the div box expand to the size of the image? if so how do i code the class to do so?

  • #2
    New Coder
    Join Date
    Feb 2009
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts
    If you set the div to width 100% the background image should expand with the div.

  • #3
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I was hoping for the image to cause the box to expand.

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,749
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    Quote Originally Posted by calmchess View Post
    Is it possible to set a background image and have the div box expand to the size of the image? if so how do i code the class to do so?
    No. A bg img can't influence the div you put it on, doesn't work that way.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •