文字没有超过图像

时间:2017-08-17 13:00:31

标签: html css caption

所以我正在制作一个需要在图像顶部设置字幕的图库/ imageshow,所以我有一部分工作,他们坐在图像上,但他们不会坐在图像上,但在与图像相同的位置最左边的图像。

enter image description here

html是图像的一部分和右边的包装等。

        <div id="wrapper">
        <div class="inner">
            <section id="mainProjects">
                <section id="headingProjects">
                    Projects
                </section>
                <section id="imagesProjects">
                    <a href="#"><section class="project"><img src="images/thumbnails/img1.jpg"/><section id="caption"><div id="text"><div id="title">Project 1</div ><div id="desc">this is some text about the project.</div></div></section></section></a>
                    <a href="#"><section class="project"><img src="images/thumbnails/img2.jpg"/><section id="caption"><div id="text"><div id="title">Project 1</div ><div id="desc">this is some text about the project.</div></div></section></section></a>
                    <a href="#"><section class="project"><img src="images/thumbnails/img3.jpg"/><section id="caption"><div id="text"><div id="title">Project 1</div ><div id="desc">this is some text about the project.</div></div></section></section></a>
                </section>
            </section>
        </div>
    </div>

这是CSS

/*
Wrapper
*/
#wrapper{
    margin: auto;
    width: 100%;
    height: 1600px;

}
#wrapper .inner{
    position: absolute;
    margin-left: 300px;
    width: 81.9%;
    height: 100%;

}
#wrapper .inner #mainProjects{
    height: 100%;
    margin-top: 120px;
}
#wrapper .inner #headingProjects{
    margin: 0 auto 10px auto;
    width: 110px;
    height: auto;
    font-size: 30px;
}
#wrapper .inner #imagesProjects a .project{
    width: 33.3%;
    height: 33%;
    display: inline-block;
    margin-right: -4px;
} 
#wrapper .inner #imagesProjects a .project img{
    position: relative;
    width: 100%;
    padding: 0;
    border: 0px;
    animation: mymoveback 0.4s 1 alternate ease-out forwards;

}
#wrapper .inner #imagesProjects a:hover .project img{
    animation: mymove 0.4s 1 alternate ease-out forwards;
}
#wrapper .inner #imagesProjects a .project #caption{
    position:absolute;
    float: left;
    top: 550px;
    left: 0px;
    width: 33.3%;
    height: 70px;
    z-index: 10px;
    background-color: rgba(0,0,0,0.2);
    color: white;
}

#wrapper .inner #imagesProjects a .project #caption #text{
    padding: 10px;
}
#wrapper .inner #imagesProjects a .project #caption #text #title{
    font-size: 24px;
}
#wrapper .inner #imagesProjects a .project #caption #text #desc{
    font-size: 12px;   
}
@keyframes mymove{
    0%{opacity: 1;}
    100%{opacity: 0.7;}
}
@keyframes mymoveback{
    0%{opacity: 0.7;}
    100%{opacity: 1;}
}

0 个答案:

没有答案