<div id="largeCarousel" style="display:inline-block; float:right;">
<div class="homepage-item" style="padding-bottom:52%; position:relative; box-sizing:border-box;">
<div id="largeCarouselContent" style="position:absolute; top:0; left:0; width:100%; height:100%; overflow-x:hidden; overflow-y:hidden">
<div style="color:white;">Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap </div>
<div>
<div style="position:relative; top:0; left:0;">Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap Content should wrap </div>
<img src="~/Content/images/Canvas1.jpg" style="position:absolute; top:0; left:0; height:100%; width:100%;" />
</div>
<div><img src="~/Content/images/logo.jpeg" style="width:100%;" /></div>
</div>
</div>
</div>
上面有一个包含滑块的内容框。内容框的纵横比为1/.52。我的目标是在每张幻灯片上有一个不同的背景图像,内容覆盖在图像上。背景图像还必须通过web访问,所以设置背景图像css属性似乎不起作用。#LargeCarouselContent中的每个div都是一个幻灯片。当前的解决方案不起作用,因为canvas1.jpeg覆盖所有幻灯片。我被难住了,有什么主意吗?
如果我很理解你,你想要一张背景图片,对吧?如果是的话,为什么不使用CSS背景图像而不是内联图像呢?并为每张幻灯片使用background-size:cover;
。因此,无论您的图像有什么纵横比,它都将填满整个容器。
.homepage-item {
background: url("~/Content/images/Canvas1.jpg") no-repeat center / cover;
box-sizing: border-box;
padding-bottom: 52%;
position: relative;
}
所以我正在通过一门课程练习一个项目,其中一个项目是基于颜色盘的,网站生成随机盘,带有一个额外的功能,用户可以改变色调,亮度,饱和度,我在中间的某个地方,但我的滑块并不像预期的那样起作用。如果我改变了色调,背景并没有相应的改变,它一直围绕着某个灰色的颜色旋转,不知怎么的,所有颜色的饱和度就会在开始的时候被卡住。我检查了色调的刻度是否正确。我试着检查console.log进入数组来检查每个初始颜色是否
下面的外部CSS页面示例中的快速简单问题; 我知道它们会影响不同的元素选择器,我的问题是使用背景和背景图像有什么区别?一方可以访问另一方的特定属性吗?谢谢你。
问题内容: 如果选择了该面板(单击该面板),则该面板的颜色为蓝色。另外,我在该面板上添加了一个小标志(图像),它表示所选面板之前已被选中。 因此,如果用户看到例如10个面板,其中有4个带有这个小标记,则他知道自己之前已经单击了这些面板。到目前为止,这项工作还不错。现在的问题是我无法显示小标志并使面板同时变为蓝色。 我使用css将面板设置为蓝色,使用设置背景图像。但是背景色似乎在图像上方,因此您看不
问题内容: 我有一个带,还有四面八方面板(华北,华东,…)。面板中大部分是标签和按钮。 现在,我希望框架具有背景图像,一些研究告诉我,我必须更改框架的内容窗格。 但是,当我尝试此操作时,内容将置于背景中并且不可见。另外,如果调整了框架的尺寸,我也不知道如何调整图像的尺寸。 有一个简单的解决方法,还是我需要重新编写大部分代码? 问题答案: 将(或)与背景图片放到,然后将其填满整个区域,其余部分则放到
问题内容: 我为设置背景图片有一个小问题。 这是我在网站上获得的html: 这是CSS: 我不知道为什么按钮的背景仍然是白色。 问题答案: 令人惊讶的是,这里没有答案解决或提及实际问题。 该CSS选择器说:“给我一个元素与ID 里面 一个元素”,就像这样: 但是,您想要的是 带有* id 的元素。而选择器将是(请注意 button 和 #rock 之间缺少的空间)。 * 正如@Greg已经提到的:
除了背景颜色,也可以使用背景图像来实现各种复杂、有趣的背景效果。CSS中,使用 background-image属性来定义背景图像的路径,取值为 none | url,默认值为 none。 url 可以是相对路径,也可以是绝对路径。使用相对路径时,url 是相对于 css 所在的文件,而不是要设置样式的HTML文件。如,下面代码表示,使用 css 文件所在目录下的 img 文件夹下的图像 bg.g