Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 调整窗口大小时居中对齐图像css_Html_Css - Fatal编程技术网

Html 调整窗口大小时居中对齐图像css

Html 调整窗口大小时居中对齐图像css,html,css,Html,Css,我希望在调整窗口大小时,图像的中心部分始终可见。我希望图像在左侧和右侧消失,使图像的中心部分可见 以下是我所拥有的: <section id="home-slider" class="flexslider fullbg" style="background-image:url(img/slide/home/1_1_c.jpg); height:600px; padding:0px;"> <ul class="slides"> <li class="

我希望在调整窗口大小时,图像的中心部分始终可见。我希望图像在左侧和右侧消失,使图像的中心部分可见

以下是我所拥有的:

<section id="home-slider" class="flexslider fullbg"
     style="background-image:url(img/slide/home/1_1_c.jpg); height:600px; padding:0px;">
<ul class="slides">
    <li class="home-slide">
        <div class="flex-caption transparent light-font center">
            <p class="home-slide-content bounceInLeft animated" data-wow-delay="0.5s" data-wow-duration="4s">
                Scape. <span class="highlight">Scope.</span> Style.<span class="highlight"> Context.</span>
            </p>

            <p class="home-slide-content bounceIn animated" data-wow-delay="2s" data-wow-duration="4s">
                We <span class="highlight">build</span> it
            </p>
        </div>
    </li>
    <li class="home-slide">
        <div class="flex-caption transparent light-font center">
            <p class="home-slide-content swing animated" data-wow-delay="2s" data-wow-duration="4s">
                Western Red <span class="highlight">Cedar Wood Cladding</span>
            </p>

            <p class="home-slide-content fadeInUp animated" data-wow-delay="2s" data-wow-duration="4s"
               style="font-size:80px;">
                <span class="highlight">Full</span> Electrics Package
            </p>
        </div>
    </li>
    <li class="home-slide">
        <div class="flex-caption transparent light-font center">
            <p class="home-slide-content flipInY animated">
                <span class="highlight">Fully</span> Insulated
            </p>

            <p class="home-slide-content slideInLeft animated">
                With a <span class="highlight">50 year guarantee </span>rubber roof
            </p>
        </div>
    </li>
</ul>
</section>

.fullbg { 
    background: none 50% / cover;
}
附言:你错过了
中心
(或速记
50%
)背景位置

.fullbg{ 背景尺寸:封面; }

哇,你必须非常擅长css,才能马上给出答案。我已经实现了它,它工作得非常完美。知识渊博。非常感谢。我会在8分钟内给你答复:等我被允许的时候!奇怪。@RobbieP14383不客气!接受答案延迟时间是允许人们在OP决定一个答案之前编写/改进答案。快乐编码。
.fullbg { 
    background: none 50% / cover;
}