Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Background image aspect ratio proportional to content

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #188564
    scatman
    Participant

    Greetings.
    This is my first post on this forum and so I ask ye who read this to bear with me

    Here is my background image for my current project: http://i.imgur.com/lcigXy7.jpg

    What I need to figure out is how do I keep my stuff in the red/pinkish area only.
    Currently with different resolutions my stuff gets all over the squared areas on the left and the right side of the image.

    My current code for it:

    html {
    background: url(“file:///C:/Users/KKK/Desktop/Gameela 0.5/bgimg.jpg”) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-backgro__und-size: cover;
    background-size:cover;
    }

    http://codepen.io/scatman/pen/MYYgvB

    Please help

    #188609
    Paulie_D
    Member

    Something like this works too:

    http://codepen.io/Paulie-D/pen/raaVXg

    #188615
    scatman
    Participant

    You guys are GODS!

    Thank you!!!!111!

    #188617
    Paulie_D
    Member

    We try harder!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.