iFrame控件在移动设备上显得太小

时间:2019-04-18 04:46:03

标签: html css iframe

我正在尝试使用iframe在我的HTML页面上添加youtube视频。 这是在大屏幕上的理想选择,但是当屏幕缩小到较小的设备尺寸时,iframe文本和控件的尺寸将远远超出要求。

我试图从那里到那里使用一些CSS修复它,但是似乎没有任何作用。

HTML文件:

extension UIView {
    func addImage() {
        let imageView = UIImageView(frame: frame)
        imageView.image = UIImage(named: "Your Image Name")
        addSubview(imageView)
        imageView.didMoveToSuperview()
    }
}

CSS文件:

    <div class="container-fluid">

        <!-- header -->

        <div class="row">
            <div class="col-sm-4 col-md-offset-1 col-md-3" id="header">
                <a href="https://www.letsmd.com/">
                    <img id='main-logo' src="<?php echo e(asset('/web/images/logo-without-Tagline.svg')); ?>">
                </a>
            </div>
        </div>

        <!-- banner -->

        <div id='banner-container'>
            <!-- <div id="transparent-div"></div> -->
            <div id='banner-text-div'>
                <h1>MEDICAL PAYMENTS CARD</h1>
                <h2>Medical EMI cover</h2>
                <h2>@ &#8377;2.74 per day !</h2>
                <section>
                    <p>sadas asdasd asdasdasdasd</p>
                    <p>dsasd asdasd asdasdas</p>
                    <p>asdsfetertertert asdasdsad</p>
                    <p>asdad frgdfgfdgd</p>
                </section>
                <button class="btn btn-success" id="apply-now-btn">Apply Now</button>
            </div>
        </div>

        <!-- features and benifits -->

        <h2 id="features-and-benifits-heading">Features & Benifits</h2>

        <div class="features-and-benifits-row row">
            <div class="col-sm-offset-1 col-sm-10 col-md-offset-2 col-md-8" id="features-and-benifits-div">
                <div class="cards-row row">
                    <div class="cards col-sm-4 col-md-4">
                        <p>Personal Accident cover of <span>2 LAKHS</span> included</p>
                    </div>
                    <div class="cards col-sm-4 col-md-4">
                        <p>Immediate <span>MEDICAL CASH</span> in less than <span>2 HOURS</span></p>
                    </div>
                    <div class="cards col-sm-4 col-md-4">
                        <p><span>NO INTEREST</span> payments upto <span>18 months</span></p>
                    </div>
                </div>
                <div class="cards-row row">
                    <div class="cards col-sm-4 col-md-4">
                        <p>Valid for <span>1+3 MEMBERS</span> of family</p>
                    </div>
                    <div class="cards col-sm-4 col-md-4" id="card-with-little-text">
                        <p>Credit limit upto <span>5,00,000</span></p>
                    </div>
                    <div class="cards col-sm-4 col-md-4">
                        <p>Covers <span>MEDICAL INSURANCE</span> deductibles</p>
                    </div>
                </div>
            </div>
        </div>

        <!-- form -->

        <div class="row" id="form-row">
            <div class='col-md-12 col-sm-12' id="form-div">
                <h2><span>Apply for Loan</h2>
                <form action="" method="POST" id="html-form">
                    <div id="form">
                        <section class="form-section">
                            <p>Enter Your Name</p>
                            <input type="text" name="name" class="class-requires-validation" maxlength="35" required id="name-input">
                            <p class="custom-error" id="custom-error-name-input"></p>
                            <p>Enter Your Mobile No.</p>
                            <input type="tel" name="tel" class="class-requires-validation" maxlength="10" required id="mobile-input">
                            <p class="custom-error" id="custom-error-mobile-input"></p>
                        </section>
                    </div>
                    <button class="btn btn-default" id='form-btn'>Apply Now</button>
                </form>
            </div>
        </div>

        <!-- treatments covered small screen -->

        <div id='treatments-div' class="md-hidden">
            <h2>Treatments Covered</h2>
            <div class='row treatments-row'>
                <div class="col-sm-6 col-md-6 treatment-cards">
                    <img src="<?php echo e(asset('/images/icons/maternity.png')); ?>" alt="">
                    <span>Maternity Cover</span>
                </div>
                <div class="col-sm-6 col-md-6 treatment-cards">
                    <img src="<?php echo e(asset('/images/icons/brain.png')); ?>" alt="">
                    <span>Organ Transplant</span>
                </div>
            </div>
            <div class='row treatments-row'>
                <div class="col-sm-6 col-md-6 treatment-cards">
                    <img src="<?php echo e(asset('/images/icons/hospital.png')); ?>" alt="">
                    <span>Hospital Admission</span>
                </div>
                <div class="col-sm-6 col-md-6 treatment-cards">
                    <img src="<?php echo e(asset('/images/icons/make-up.png')); ?>" alt="">
                    <span>Cosmetic Treatment</span>
                </div>
            </div>
            <div class='row treatments-row'>
                <div class="col-sm-6 col-md-6 treatment-cards">
                    <img src="<?php echo e(asset('/images/icons/serum.png')); ?>" alt="">
                    <span>Day Care Surgery</span>
                </div>
                <div class="col-sm-6 col-md-6 treatment-cards">
                    <img src="<?php echo e(asset('/images/icons/reproduction.png')); ?>" alt="">
                    <span>Infertility Treatments</span>
                </div>
            </div>
        </div>

        <!-- treatments covered large screen -->

        <div id='treatments-div' class="sm-hidden">
            <h2>Treatments Covered</h2>
            <div class='row treatments-row'>
                <div class="col-sm-6 col-md-4 treatment-cards">
                    <img src="<?php echo e(asset('/images/icons/maternity.png')); ?>" alt="">
                    <span>Maternity Cover</span>
                </div>
                <div class="col-sm-6 col-md-4 treatment-cards">
                    <img src="<?php echo e(asset('/images/icons/brain.png')); ?>" alt="">
                    <span>Organ Transplant</span>
                </div>
                <div class="col-sm-6 col-md-4 treatment-cards">
                    <img src="<?php echo e(asset('/images/icons/hospital.png')); ?>" alt="">
                    <span>Hospital Admission</span>
                </div>
                <div class="col-sm-6 col-md-4 treatment-cards">
                    <img src="<?php echo e(asset('/images/icons/make-up.png')); ?>" alt="">
                    <span>Cosmetic Treatment</span>
                </div>
                <div class="col-sm-6 col-md-4 treatment-cards">
                    <img src="<?php echo e(asset('/images/icons/serum.png')); ?>" alt="">
                    <span>Day Care Surgery</span>
                </div>
                <div class="col-sm-6 col-md-4 treatment-cards">
                    <img src="<?php echo e(asset('/images/icons/reproduction.png')); ?>" alt="">
                    <span>Infertility Treatments</span>
                </div>
            </div>
        </div>

        <!-- video -->

        <div class="row" id="parent-video-div">
            <div class='col-md-offset-1 col-md-10 col-sm-12' id="video-div">
                <!-- <video width="775" controls>
                    <source src="https://www.youtube.com/embed/tgbNymZ7vqY" type="video/mp4">
                    <source src="https://www.youtube.com/embed/tgbNymZ7vqY" type="video/ogg">
                    Your browser does not support HTML5 video.
                </video> -->
                <iframe width="775" height="345" src="https://www.youtube.com/embed/tgbNymZ7vqY" allowfullscreen frameborder='0'>
                </iframe>
            </div>
        </div>

        <!-- faq -->



        <!-- testimonials -->

        <div class="row testimonial-row">
            <h2 id="testimonials-title">What our client says about us ?</h2>
            <div id="myCarousel" class="carousel slide" data-ride="carousel">
                <!-- Indicators -->
                <ol class="carousel-indicators">
                    <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                    <li data-target="#myCarousel" data-slide-to="1"></li>
                    <li data-target="#myCarousel" data-slide-to="2"></li>
                    <li data-target="#myCarousel" data-slide-to="3"></li>
                </ol>
                <!-- Wrapper for slides -->
                <div class="carousel-inner">
                    <div class="item active">
                        <div class="testimonial-card">
                            <p>
                                I had to spend 4 lakhs on my treatment and credit cards were charging high interest after 45 days, got timely help from LetsMD to pay in 18 months without any interest cost. Kudos to LetsMD team
                            </p>
                            <img src="<?php echo e(asset('/images/icons/dic.png')); ?>" alt="">
                            <p>- Rishabh Bhatnagar</p>
                        </div>
                    </div>
                    <div class="item">
                        <div class="testimonial-card">
                            <p>
                                My wife was suffering from Dengue which was not covered under her medical insurance, it required platelet transfusion, and 5 days of hospitalisation. Thanks to our Medical Card we were able to pay for the treatment cost in Interest free EMI"s
                            </p>
                            <img src="<?php echo e(asset('/images/icons/dic.png')); ?>" alt="">
                            <p>- Himanshu Sehgal</p>
                        </div>
                    </div>
                    <div class="item">
                        <div class="testimonial-card">
                            <p>
                                After my marriage I got to know that I can not include father in my medical insurance policy. I was forced to buy a separate policy with premium of Rs 30k instead of normal 10k. LetsMD Medical Card came to my rescue where I included my father at just additional cost of Rs 500.
                            </p>
                            <img src="<?php echo e(asset('/images/icons/dic.png')); ?>" alt="">
                            <p>- Kokila Srivastava</p>
                        </div>
                    </div>
                    <div class="item">
                        <div class="testimonial-card">
                            <p>
                                I got admitted for severe stomach pain and was well covered by Health Insurance. It was found to be Appendicitis and doctor told me that operation is needed. My insurance company took more than a day to approve a cashless operations while I went through unbearable pain. Finally I had to arrange money from my friend for operation done as insurance company was taking time. Now i have taken the card to ensure I get cash whenever i need without a wait.
                            </p>
                            <img src="<?php echo e(asset('/images/icons/dic.png')); ?>" alt="">
                            <p>- Ashish Sinha</p>
                        </div>
                    </div>                
                </div>
                <!-- Left and right controls -->
                <a class="left carousel-control" href="#myCarousel" data-slide="prev">
                    <span></span>
                    <span class="sr-only">Previous</span>
                </a>
                <a class="right carousel-control" href="#myCarousel" data-slide="next">
                    <span></span>
                    <span class="sr-only">Next</span>
                </a>
            </div>
        </div>

        <!-- media mentions -->

        <div class="row">
            <div class='col-md-offset-1 col-md-10 col-sm-12' id="media-mentions-div">
                <h2><span>MEDIA</span> MENTIONS</h2>
                <div class="row">
                    <div class="col-md-offset-2 col-md-2 col-sm-3">
                        <img class="img-responsive" src="<?php echo e(asset('/web/loancard/Media/2017.10.06_09-23-18bhaskar.png')); ?>">
                    </div>
                    <div class="col-md-2 col-sm-3">
                        <img class="img-responsive" class="img-responsive"src="<?php echo e(asset('/web/loancard/Media/vccircle.png')); ?>">
                    </div>
                    <div class="col-md-2 col-sm-3">
                        <img class="img-responsive" src="<?php echo e(asset('/web/loancard/Media/TheHindu-Logo.png')); ?>">
                    </div>
                    <div class="col-md-2 col-sm-3">
                        <img class="img-responsive" src="<?php echo e(asset('/web/loancard/Media/Zee-Business-CS6-1110x550.png')); ?>">
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-offset-2 col-md-2 col-sm-3">
                        <img class="img-responsive" src="<?php echo e(asset('/web/loancard/Media/dribbble_001_2x.png')); ?>">
                    </div>
                    <div class="col-md-2 col-sm-3">
                        <img class="img-responsive" src="<?php echo e(asset('/web/loancard/Media/the-economic-times-logo-png-1.png')); ?>" >
                    </div>
                    <div class="col-md-2 col-sm-3">
                        <img class="img-responsive" src="<?php echo e(asset('/web/loancard/Media/yahoo-logo-png-transparent-background-768x256.png')); ?>">
                    </div>
                    <div class="col-md-2 col-sm-3">
                        <img class="img-responsive" src="<?php echo e(asset('/web/loancard/Media/yourstory.png')); ?>">
                    </div>
                </div>
            </div>
        </div>

        <!-- footer -->

        <div class="row" id='footer'>
            <div class="col-md-6 col-sm-6 pull-left">
                <p>Copyright © {{ date('Y') }} LetsMD. All rights reserved  </p>
            </div>
            <div class="col-md-offset-1 col-md-5 col-sm-6 pull-right">
                <p>
                    <span>Get social with us</span> 
                    <a href="https://www.facebook.com/LetsMDMedbay/" target="_blank">
                        <span class="fa-stack fa-md">
                            <i class="fa fa-circle fa-stack-2x"></i>
                            <i class="fa fa-facebook fa-stack-1x fa-inverse"></i>
                        </span>
                    </a>
                    <a href="https://www.youtube.com/channel/UC4urUJpHcA9LpeRQ1O2hdjw" target="_blank">
                        <span class="fa-stack fa-md">
                            <i class="fa fa-circle fa-stack-2x"></i>
                            <i class="fa fa-youtube-play fa-stack-1x fa-inverse"></i>
                        </span>
                    </a>
                    <a href="https://in.linkedin.com/company/letsmd" target="_blank">
                        <span class="fa-stack fa-md">
                            <i class="fa fa-circle fa-stack-2x"></i>
                            <i class="fa fa-linkedin fa-stack-1x fa-inverse"></i>
                        </span>
                    </a>
                </p>
            </div>
        </div>

    </div>

屏幕截图(桌面):

enter image description here

屏幕截图(移动设备):

enter image description here

0 个答案:

没有答案