Set size on background image with CSS?

后端 未结 18 1655
野性不改
野性不改 2020-11-22 12:38

Is it possible to set the size of the background image with CSS?

I want to do something like:

background: url(\'bg.gif\') top repeat-y;
background-si         


        
18条回答
  •  青春惊慌失措
    2020-11-22 13:04

    I use background images for buttons, but it only shows the image the same size as the text, even if I set width and height. Instead, I pad out my text with   characters (non-breaking spaces). I slap in as many as needed, basically, until all the button background appears. So I might have code like this:

    In the style sheet:

    #v2menu-home {
        background-image:url(../v2-siteimages/button.png);
        background-repeat:no-repeat;
    }
    

    In the HTML document:

    
    

提交回复
热议问题