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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2011
    Posts
    172
    Thanks
    64
    Thanked 2 Times in 2 Posts

    Does something like this should work?

    <div id="header"></div>

    and in css file

    #header { background-image: url(../img/custom/header.jpg); }

    I am stuck for about 2 hours and can't get an image to display on a simple website.

    Thank you.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,666
    Thanks
    22
    Thanked 1,826 Times in 1,810 Posts
    Hello joliett89,
    Give that header a size, a background image will not show without something expanding the element.

    Try something like this in your CSS
    Code:
    #header { 
    width: 600px;
    height: 100px;
    background-image: url(../img/custom/header.jpg);
     }
    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

  • Users who have thanked Excavator for this post:

    joliett89 (11-16-2012)


  •  

    Posting Permissions

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