Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

VitorMFig

Z-Index ?

Recommended Posts

Fala galera, estou desenvolvendo um site, e hoje me deparei com esse problema, a imagem do carrossel/SlideShow está ficando por cima do header, mesmo com o Z-index, podem me ajudar?

HTML:

<section id='head'>
            <nav>
                <ul>
                    <li><a class='.transition' href="#">Sobre</a></li>
                    <li><a class='.transition' href="#">Portifólio</a></li>
                    <li><a class='.transition' href="/"><img src="img/logo.png"></a></li>
                    <li><a class='.transition' href="#">Contato</a></li>
                    <li><a class='.transition' href="#">Orçamento</a></li>
                </ul>
            </nav>
        </section>
        <section id='slides'>
            <section id='images'>
                <img src="img/slide/slides/1.jpg">
            </section>
        </section>

CSS:

#head{
    float: left;
    width:100%;
    height:100px;
    background: url(../img/background.png);
    border-bottom: 3px solid  rgb(132, 13, 13);
    z-index: 1;
}
#head nav{
    width: 1020px;
    height: 100px;
}
#head nav ul li img{
    float: right;
    width: auto;
    height: 100px;
    background:url(../img/background.png);
    border:3px solid  rgb(132, 13, 13);
    border-top: none;
    margin-top: 55px;
}
/*Slides*/
#slides{
    float: left;
    width: 100%;
    height: 500px;
    background: url(../img/slide/background.png) repeat;
}
#slides img{
    width: auto;
    height: 500px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index:0;
} 

imagem:

Lh9O856.jpg

Compartilhar este post


Link para o post
Compartilhar em outros sites

z-index só funciona em elementos que tenham a propriedade position setada para algum valor diferente de static (que é o default).

 

Vc colocou um z-index ali:

#head{
    float: left;
    width:100%;
    height:100px;
    background: url(../img/background.png);
    border-bottom: 3px solid  rgb(132, 13, 13);
    z-index: 1;
}
mas não colocou nenhum position.. ai o z-index não tem efeito.

#head{
    float: left;
    width:100%;
    height:100px;
    background: url(../img/background.png);
    border-bottom: 3px solid  rgb(132, 13, 13);
    z-index: 1;
    position: relative;
}

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.