Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.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 拉伸图像以适合特定的分区_Html_Css_Image - Fatal编程技术网

Html 拉伸图像以适合特定的分区

Html 拉伸图像以适合特定的分区,html,css,image,Html,Css,Image,我有以下包含图像的div: 以下是HTML及其样式: <ul id="noty_centerRight_layout_container" class="i-am-new" style="right: 20px; position: fixed; width: 310px; height: auto; margin: 0px; padding: 0px; list-style-type: none; z-index: 10000000; top: 339.5px;"> &l

我有以下包含图像的div:

以下是HTML及其样式:

 <ul id="noty_centerRight_layout_container" class="i-am-new" style="right: 20px; position: fixed; width: 310px; height: auto; margin: 0px; padding: 0px; list-style-type: none; z-index: 10000000; top: 339.5px;">
   <li style="overflow: visible; border-radius: 5px; background-color: rgb(255, 255, 255); border-color: rgb(204, 204, 204); color: rgb(68, 68, 68); width: 310px; cursor: pointer; min-height: 349px;" class="animated bounceIn">
      <div class="noty_bar noty_type_alert" id="noty_4752181183881090">
         <div class="noty_message pop-activity default-yellow" style="font-size: 13px; line-height: 16px; text-align: left; padding: 15px; width: auto; position: relative;">
            <div class="noty_text">
               <h3></h3>
               <p>                                                                                                                          <button title="Close (Esc)" type="button" class="popup-close">×</button></p>
               <p><a href="/half-price" target="_blank"><img style="width: 350px;" src="https://img.alleop.bg/catalog/Banners-Front/Popup-Product-banners/IMG_27082018_165243_0.png"></a></p>
               <p></p>
            </div>
         </div>
      </div>
   </li>
</ul>
  • ×

我想使图像与id为的div大小相等

诺蒂大学677289985142816800 此外,我还补充了

    ×

您可以将其设置为上面的div链接的背景图像

<div class="noty_message pop-activity default-yellow" style="font-size: 13px; line-height: 16px; text-align: left; padding: 15px; width: auto; position: relative; background: url('https://img.alleop.bg/catalog/Banners-Front/Popup-Product-banners/IMG_27082018_165243_0.png'); background-size: 100%; height: 220px;">
                    <div class="noty_text">
                        <h3></h3>
                        <p>
                            <button title="Close (Esc)" type="button" class="popup-close">×</button>
                        </p>
                        <p><a href="/half-price" target="_blank"><!-- <img style="width: 350px;" src="https://img.alleop.bg/catalog/Banners-Front/Popup-Product-banners/IMG_27082018_165243_0.png"> --></a></p>
                        <p></p>
                    </div>
                </div>

“noty_677289985142816800,我还添加了”=>您还添加了什么?检查(f12,在大多数浏览器中)并查看图像或div容器是否有边距或填充,algo,您需要使用宽度:100%以全尺寸拉伸图像您是否尝试过
对象拟合:cover在你的图像上?
background: url('https://img.alleop.bg/catalog/Banners-Front/Popup-Product-banners/IMG_27082018_165243_0.png'); 
background-size: 100%; 
height: 220px;