Skip to content Skip to sidebar Skip to footer

How To Position A Background Image Like Wanderfly.com?

Hey guys. i want to be able to position my image background similar to www.wanderfly.com . the source of that page shows that they use an hidden input field: Copy

Solution 3:

If you want to have a fullscreen background image that stretches 100% width and height of a monitor without having it be squished or pinched because the users monitor is a widescreen, try the following code. it worked wonders for me.

CSS:

img.bg {
    /* Set rules to fill background */
    min-height: 100%;
    min-width: 1024px;

    /* Set up proportionate scaling */
    width: 100%;
    height: auto;

    /* Set up positioning */
    position: fixed;
    top: 0;
    left: 0 ;
    z-index: -1;
}

@media screen and (max-width: 1024px){
    img.bg {
        left: 50%;
        margin-left: -512px; 
    }
}

HTML PAGE:

<asp:Image ID="imgBG" runat="server" CssClass="bg" ImageUrl="~/Sites/0/PageLayouts/Images/Background.jpg" />

Post a Comment for "How To Position A Background Image Like Wanderfly.com?"