我可以在图像上有div元素吗?

时间:2015-07-24 05:03:35

标签: html css

我在该图像上使用SVG图像我需要在图像上设置div以在图像上设置按钮区域。我在我的html文件中放置了div内容,但我的图像文件隐藏了div内容。怎么做? 这是我的HTML代码:

<div class="fancybox" id="nav" href="#inline1"/>
<img src="billing.svg" id="my_image" class="gold1"/>// this is my image over this I need to place the div content

这是我的CSS文件:

#nav {
    line-height:30px;
    background-color:#00FF66;
    height:400px;
    width:200px;
    float:left;
    padding:9px;          
}

2 个答案:

答案 0 :(得分:0)

.outerBoxContent{position: relative;}
.outerBoxContent .fancybox{position: absolute;top: 0px;left: 0px;height: 100%;width: 100%:z-index:123}

的CSS

Repo.clone_from("source", "target")

这是您可以将内容放在div上的方式。

答案 1 :(得分:0)

    .fancybox{
    position:relative;
    height://height go image
    width:// of image
    }
    .fancybox img{
    position:absolute;
    height://height go image
    width:// of image
    z-index:-1;
    }

    .myDiv{
    position:absolute;
    width:// width of dive
    z-index:1;
    left://margin from left
    right://margin right
    top:margin from top
    bottom:margin from bottom

}


<div class="fancybox" id="nav" href="#inline1"/>
<img src="billing.svg" id="my_image" class="gold1"/>
<div class="myDiv"></div>

</div>