You must Sign In to post a response.
  • Category: HTML

    How to fit Image or Video Automaticaly in mobile using bootstrap css


    Are you looking for a way to fit Image or Video Automaticaly in mobile using bootstrap css ? then read this thread to know to set it



    In bootstrap css how to fit Image or Video Automaticaly to All Mobile Device based on its Resolution.Please can any one suggest how to achieve.
  • #756384
    Hai Navaneetha Krishnan,
    The bootstrap support is not responsive to the images and videos. So i think its better to use the classes img-responsive as shown in the below link for the re-sizing the image based on the browser shrink:

    http://www.bootply.com/70929

    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #756391
    To set image dynamically, You can calculate your image ratio if it's known then set its padding to the ratio
    checkout following code and below link

    <div class="img-container">
    <img src="">
    </div>

    .img-container {
    position:relative;
    padding-top:66.59%;
    }

    img {
    position: absolute;
    top: 0;
    left: 0;
    width:100%;
    }

    http://jsfiddle.net/J8AYY/7/

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]


  • Sign In to post your comments