Search code examples
cssimagewidth

background-size width only


I have made a full screen slide show on a web page I am making, but as a entry page after they are 'done' with the slide show..I want to put a picture on top with the width expanding to full size in width after the resolution to the user. While the height is gonna be static..like 600px.

Is there a way to do this? With CSS or something? I am new to CSS and after googling for many days I havent found any decent example of what I am trying to make

I do not have any example ready of what I am trying to archieve, but hopefully someone will have a idea of what I am trying to do.

Thanks in advance


Solution

  • You can try with a container like this

    HTML:

    <div id="boom">
        plop
    </div>
    

    CSS:

    #boom {
        width: 100%;
        height: 600px;
        background: url(http://placehold.it/1600x600);
    }
    

    Result: http://jsfiddle.net/fx5jM/