image does not go 100% to the right

This question already has an answer here:

  • Stretch and scale a CSS image in the background - with CSS only 18 answers

  • You could "stretch" your background image to 100%, using the background-size property.

    background-size: 100%;
    

    Your CSS:

    #navbar {
       background-image: url('../images/nav.png');
       background-repeat: no-repeat;
       background-color: black;
       background-size: 100%;
    }
    

    http://jsfiddle.net/FDVby/7/


    使用background-size属性以下是文档:https://developer.mozilla.org/en-US/docs/CSS/background-size

    链接地址: http://www.djcxy.com/p/89220.html

    上一篇: 图像的高度

    下一篇: 图像不会100%向右