html - 拉伸图像以适应特定的 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 大小相同
noty_677289985142816800 另外,我添加了
解决方案
<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;">
<button title="Close (Esc)" type="button" class="popup-close">×</button>
<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" style="background-color:blue;">
<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">
<p><a href="/half-price" target="_blank"><img style="width:310px;margin-top:-28px;margin-left:-15px;height:311px;" 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>
试试这个代码。
推荐阅读
- flutter - 如何通过单击下载按钮从服务器将视频下载到 Android 手机?
- c# - 如何用添加参数的私有方法替换巨大的 lambda 表达式?
- r - 有没有办法在 R-studio 的这个方程中找到一个解决方案/近似 P 的值
- python - 如何将边界框中的像素和图像更改为黑色?
- angularjs - 如何使用 .cshtml 剃须刀文件作为 ui-grid 单元格模板?
- python - 在 numpy 数组中找到噪声填充区域之间的最大差异
- html - 在自定义位置使用 FastAPI 将数据框下载为 excel
- rest - 使用 Spring Boot 生成 API 路由器和模拟方法,并将 API 定义作为输入(RAML)
- php - 将字符串作为参数传递给 PHP PDO 中的 execute([$string_list])
- c# - MVC 多语言项目转回默认语言