Resize background image in div using css

With this code, you can resize background image in div automatically using css:

  1. CSS:
    <style type="text/css">   
    #contentMain {  
      margin-bottom: 5%; 
      margin-top: 10%;
      margin-left: 10%;
      margin-right: 10%;
      background: url( /jQuery/mypage/img/background1.png );    
      background-size: contain; 

Reference link:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s