Tuesday, 26 January 2016

HTML5 set responsive background image


CSS
_______________________________________________________

       html, body {
            margin: 0;
            padding: 0;
            color: white;
            height: 100%;
            text-align: center;
        }

        #background {
            background: #000000 url('image/bg.jpeg') no-repeat bottom left;
            background-size: 100% 100%;
            width: 100%;
            height: auto !important;
        }


HTML
_______________________________________________________

<htlm>
      <body id="background">
      </body>
</html>

No comments:

Post a Comment