繁体   English   中英

如何使我的图像拼贴在背景中透明

[英]How to make my tiles of images to be in background as transparent

我创建了一组图块格式的图像,例如在3行的方形框中连续显示10张图像。 现在,我希望我的图像拼贴在背景中并且也是透明的。 我想在图像图块的顶部再放置一个div元素。 例如:我希望我的页面像是:www.befunky.com

在瓷砖中排列有图像的地方,并在其上方提供了纯屏幕。 背景图块图像可见。 我知道他们可能为此使用了图像,但是我的要求是我想使用CSS来完成。

我的代码如下:

          <div class="in-section">
            <div class="tiles tile1">
            </div>
            <div class="tiles tile2">
            </div>
            <div class="tiles tile3">
            </div>
            <div class="tiles tile4">
            </div>
            <div class="tiles tile5">
            </div>
            <div class="tiles tile6">
            </div>
            <div class="tiles tile7">
            </div>
            <div class="tiles tile8">
            </div>
            <div class="tiles tile9">
            </div>
            <div class="images">
            </div>
        </div>

我的CSS是:

 .in-section{
margin-top:10px;
height:470px;
width:470px;
background-color:red;
margin-left:380px;
  }


 .tiles{
height:150px;
width:150px;
background-color:grey;
float:left;
border: 1px solid green;    
 }

.tile1, .tile2, .tile3, .tile4, .tile5, .tile6, .tile7 , .tile8, .tile9{
    padding:2px;
    margin:3px;
 }

添加这些CSS样式。 使用z-index将图片发送到in div部分。

.tiles{
    position: relative;
    z-index: -50; 
}
.in-section{
    background-color:rgba(255,0,0,.8); //rgba color for red with some transparency.
};

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM