我想调整 <div> 区域的大小,同时图像被调整 "img-responsive" of Bootstrap

I'd like to resize <div> area while an image is resized by "img-responsive" of Bootstrap

当我调整浏览器大小时,图像也会调整大小。这很好,因为这是我想做的。 但是,黑色区域的下部不会调整大小。所以在手机浏览器中,图片下方有黑色区域。我想修复它,但我不知道该怎么做。你能给我一些建议吗?

我的页面是here

{% load staticfiles %}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">  <!-- for IE --> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"> 
    <title>Learning BxSlider</title>
    <link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" />
    <link href="{% static "bxslider/jquery.bxslider.css" %}" rel="stylesheet">
    <style type="text/css">
        body {
            color: red;
        }
        .container-fluid {
            margin: 0;
            padding: 0;
        }
        .row {
            margin: 0;
            padding: 0;
        }
        article#apple {
            width: 100%;
        }
        div#berry {
            height: 250px;
        }
        img.melon {
            display: block;  /* center */
            margin: auto;
        }
        .bxslider li {
            height: 250px;
        }
        h2.juice {
            position: relative;
            top: -250px;
            z-index: 10;
        }
        /*li#orange {
            background: center url("http://coolwebwindow.com/jquery-lab/wp-content/demo/bxslider_filter/images/photo01.jpg") no-repeat;
        }
        li#lemon {
            background: center url("http://coolwebwindow.com/jquery-lab/wp-content/demo/bxslider_filter/images/photo04.jpg") no-repeat;
        }*/
        .bx-wrapper .bx-viewport {  /* remove border */
            box-shadow: none;
            border: none;
            left: 0;
            right: 0;
            background-color: black;
        }
    </style>
</head>
<body>
    <section class="container-fluid">
        <article id="apple">
            <div class="row" id="berry">
                <ul class="bxslider">
                    <li id="orange" class="">
                        <img class="img-responsive melon" src="http://coolwebwindow.com/jquery-lab/wp-content/demo/bxslider_filter/images/photo01.jpg">
                        <h2 class="juice">Himawari</h2>
                    </li>
                    <li id="lemon" class="">
                        <img class="img-responsive melon" src="http://coolwebwindow.com/jquery-lab/wp-content/demo/bxslider_filter/images/photo04.jpg">
                        <h2 class="juice">Sumire</h2>
                    </li>
                </ul>  <!-- bxslider -->
            </div>
            <div>
                <span>BxSlider is difficult in Design</span>
            </div>
        </article>
    </section>


    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
    <script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    <script src="{% static "bxslider/jquery.bxslider.min.js" %}" type="text/javascript" ></script>
    <script type="text/javascript">
        $(function(){
            $('.bxslider').bxSlider({
                auto: true
            });
        });
    </script>

</body>
</html>

使用:BootstrapjQueryBxSlider

给出高度:100%;图片标签

删除所有父元素的高度

 div#berry {
    /* height: 250px; */
 }

删除高度

.bxslider li {
    height: 250px;
}
div#berry {
    height: 250px;
}

它应该可以工作

此外,您可以使用以下代码替换您现有的 h2.juice 代码,这也将删除剩余的黑色 space

h2.juice {
    position: absolute;
    z-index: 10;
    top: 50%;
    margin: 0;
    left: 20%;
}

别忘了刷新页面查看图片以供参考here