2015-01-20 49 views
-1

你好,我是新来的CSS和我需要一些援助。我想为我的网站在CSS中创建3层,所以它看起来像我在下面提供的图片。创建不同的CSS层

Picture Provided

我怎么会去在CSS中设置此功能?任何帮助将非常感激。

谢谢。

+0

您没有提供任何标记的代码示例,因此很难评估你的情况。下面是关于如何创建一个MCVE的指南:http://stackoverflow.com/help/mcve – Terry 2015-01-20 23:20:49

+0

我只需要知道是否有可能创建3个不同的容器与以下背景以及我将如何去做呢?谢谢。 – 2015-01-20 23:22:12

+2

简答:**是的,这是可能的**。再次,没有任何标记,我们应该如何帮助?在所以它有助于你带来一个特定的问题陈述,显示你到目前为止所尝试的*。 – Terry 2015-01-20 23:23:05

回答

2

您想了解z-index属性。但基本上,任何你应用z-index需要有一个position设置...我很确定static不起作用,但absoluterelative & fixed都做到了。那么你可以订购它们。例如:

.div-background{ 
    z-index:1; 
    position:relative; 
} 
.div-middle{ 
    z-index:2; 
    position:relative; 
} 
.div-front{ 
    z-index:3; 
    position:relative; 
} 

有意义吗?

+0

非常感谢。是的,这是有道理的,我会看看,看看我如何去。 – 2015-01-20 23:25:11

0

所有你需要做的是在花样的背景IMG添加到CSS 这里的

div { 
background: url(../images/purpalt.png) repeat; 
} 

[http://www.bootply.com/4iBwk4Tmfr][1]

/* CSS used here will be applied after bootstrap.css */ 

/* Custom container */ 
.container-full { 
    margin: 0 auto; 
    width: 100%; 
    background: #666; 
} 

.jumbotron { 
    background: black; 
    height: 553px; 

    } 

.container { 
    background: #ccc; 
    padding: 15px 10px; 
    height: 553px; 
    width: 960px; 
    } 

    .image-box { 
    background: #fff; 
     text-align: center; 
     height: 500px; 
    } 

    footer { 
     background: orange; 
     height: 190px; 


<div class="container-full"> 

     <div class="jumbotron"> 

     </div> 

    <div class="container"> 
    <div class="col-md-12"> 
     <div class="image-box"> 
    Image to go here 

     </div> 
    </div> 


    </div>  


</div> <!-- /container full --> 
<footer></footer> 
+0

谢谢你。通过在页面底部制作页脚,进一步提高了一点。唯一的问题是它滞留在那里,页面越长,它就不会移动。我的HTML代码,

和css是.footer { \t背景颜色:#F6861F; width:1920px; height:190px; 职位:固定; } – 2015-01-21 01:10:56