www.webdeveloper.com
Results 1 to 7 of 7

Thread: background image 1

Hybrid View

  1. #1
    Join Date
    Apr 2013
    Posts
    36

    background image 1

    hi

    i have background image height 364px width and 960px width.

    how i make the background 364 height and 100% or 1284px width , without repeat.

    ?

  2. #2
    Join Date
    Jan 2004
    Location
    chertsey, a small town s.w. of london, england.
    Posts
    1,472
    Hi there vdftr,

    try it like this...
    Code:
    
     your element {
        background-image:url(your image);
        background-size:100% 364px;
        background-repeat:no-repeat;
     }
    

    coothead

  3. #3
    Join Date
    Jan 2004
    Location
    chertsey, a small town s.w. of london, england.
    Posts
    1,472
    Hi there vdftr,

    use this then...
    Code:
    
    #header {
        background-image:url(img/header.jpg);
        background-size:100% 364px;
        background-repeat:no-repeat;
        background-attachment:fixed;
     }
    

    coothead

  4. #4
    Join Date
    Apr 2013
    Posts
    36
    it dont work

    because i told you i have image with 960px width
    when i do 100% is still 960px width;

  5. #5
    Join Date
    Apr 2013
    Posts
    36
    its work only when i do padding-top: 364px;


    when i do this

    #header {
    background-image:url(img/header.jpg);
    background-size:100% 364px;
    background-repeat:no-repeat;
    }

    i dont see the image;

  6. #6
    Join Date
    Apr 2013
    Posts
    36
    i dont know why but is only work when i put 364px padding top

  7. #7
    Join Date
    Jan 2004
    Location
    chertsey, a small town s.w. of london, england.
    Posts
    1,472
    Hi there vdftr,

    the "#header element" has a default height of zero.

    The background-image will not appear in full until it has content equal to the
    height of the background-image, which in your case is 364px.

    I misread your previous post and gave code that would have been appropriate
    for the "body element"


    coothead

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles