正确的CSS / JS参数填充div [英] Correct CSS / JS parameters to fill div

查看:87
本文介绍了正确的CSS / JS参数填充div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个幻灯片,我想完全填充一个div。
现在,如果有人从狭窄的浏览器视口访问我的网站,幻灯片将只填充宽度,但不填满整个高度,因此在div底部留下空间。

I have a slideshow that I would like to fill a div completely. Right now, if someone visits my site from a narrow browser viewport, the slideshow will only fill the width but not the entire height, therefore leaving space at the bottom of the div.

我希望幻灯片以按比例缩放以适合并覆盖整个div,即使需要从侧面裁剪

下面是一个例子:
如果你现在从一个宽屏或全屏浏览器窗口访问它,图像可能填充整个div。 但是如果缩小窗口并刷新,则会在div底部看到bg颜色。示例:
http://mudchallenger.com/a-responsivef.html

Here's the example: If you visit it right now from a wide or full screen browser window, the images probably fill the entire div. But if you narrow your window and refresh, you will see the bg color at the bottom of the div. Example: http://mudchallenger.com/a-responsivef.html

如何获得此幻灯片以填充

How can I get this slideshow to fill the div?

谢谢!

推荐答案

幻灯片更改位置:绝对

.slideshow  {
     position: absolute;
 }

这篇关于正确的CSS / JS参数填充div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆