[英]Fluid Image within a fixed Div not re-sizing
Thanks in advance for any and all help and responses. 在此先感谢您提供的所有帮助和回复。 I have a fixed div which floats at the bottom of the screen and is used as ad space for a mobile version of a website. 我有一个固定的div,它浮动在屏幕底部,用作网站移动版本的广告空间。 The live version can be found here: http://www.catholiccourier.com/?mobileFormat=true . 实时版本可以在以下位置找到: http : //www.catholiccourier.com/?mobileFormat=true 。 For some reason, when I try to re-size the browser window, the image inside the fixed div does not seem to shrink properly. 由于某些原因,当我尝试调整浏览器窗口的大小时,固定div中的图像似乎无法正确缩小。 If I resize the window abruptly the image shrinks, but it wont resize the same way as the header logo for example. 如果我突然调整窗口大小,则图像会缩小,但不会像标题徽标一样调整大小。 Also it does not seem to stay centered. 而且它似乎并没有保持居中。 I have tried margin:0 auto; 我已经尝试过margin:0 auto; and text-align:center on the outer div, but it does not seem to work. 和text-align:center位于外部div上,但似乎不起作用。 There are some script tags inside the div as well as noscript, and I am wondering if they may be the cause of the issue. div和noscript中都有一些脚本标签,我想知道它们是否可能是问题的原因。
You can see all of the code in the live website, but here is a copy of some of the code. 您可以在实时网站中看到所有代码,但这是其中一些代码的副本。
<div id="adSpace" align="center">
<script language="javascript" src="http://www.catholiccourier.com/banman/a.aspx?ZoneID=43&Task=Get&IFR=False&Browser=NETSCAPE4&PageID=9311&SiteID=2&Random=1375796513537"></script>
<a href="http://catholiccourier.com/banman/a.aspx?Task=Click&ZoneID=43&CampaignID=265&AdvertiserID=79&BannerID=242&SiteID=2&RandomNumber=655331242&Keywords=" target="_Blank" class="ui-link">
<img src="http://catholiccourier.com/banman/ads/3/HOLY-SEP-REWORK_fix.gif" width="728" height="90" alt="Holy Sepulchre Cemetery 585-458-4110" align="Center" border="0">
</a>
<br>
<noscript>
<a href="http://www.catholiccourier.com/banman/a.aspx?ZoneID=43&amp;Task=Click&amp;Mode=HTML&amp;SiteID=2&amp;PageID=9311" target="_blank"> <img src="http://www.catholiccourier.com/banman/a.aspx?ZoneID=43&amp;Task=Get&amp;Mode=HTML&amp;SiteID=2&amp;PageID=9311" width="728" height="90" border="0" alt=""></a>
</noscript>
</div>
Please help and thank you. 请帮忙,谢谢。
you can use position:absolute for your div 您可以为您的div使用position:absolute
.ui-mobile #adSpace {
position: absolute;
bottom: 0;
background-color: #e6e6e6;
width: 100%;
height: auto;
max-height: 90px;
z-index: 9999;
text-align: center;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.