我编写了包含样式表的html代码。图像,标题在类中出现,我想在标题上显示图像。现在,它出现在图像层下面。而且标题也不适合数据层。帮我..。以下是html代码:
<div id="layout-panel">
<div id="tile-container">
<div id="tiles-panel" data-bind="foreach: data">
<div class='row-horizontal-tile'>
<div class='data-layer'>
<div><img data-bind="attr:{src:ImageUrl}" class="stick-image"/></div>
<div class='text-title' data-bind="text: Title">
</div>
</div>
</div>
</div>
</div>
</div>上述html代码的css如下所示:
.row-horizontal-tile
{
margin:10px 5px 8px 1%;
width: 23%;
height: 90%;
display: inline-block;
}
.data-layer
{
color:#ffffff;
font-family:Calibri;
text-align:inherit;
color:Black;
background-color: white;
height: 100%;
width:100%;
border-width: 3px;
border-style:outset;
}
.stick-image
{
height: 100%;
width:100%;
background-color: white;
}
.text-title
{
font-family: DokChampa;
font-size: large;
text-align:center;
}
#layout-panel
{
background-color: #444444;
width: 100%;
height: 70%;
}
#tile-container
{
height: 80%;
width: 90%;
background-color:#CCCCCC;
position:relative;
top: 10%;
left: 5%;
}
#tiles-panel
{
height: 100%;
white-space:nowrap;
overflow-x:hidden;
overflow-y:hidden;
}提前谢谢..。
发布于 2012-07-18 04:48:20
在下面的类中添加这些属性可能会帮助您:
.data-layer{ position:relative;}
.text-title{ position:absolute; z-index:9; bottom:5px; right:5px;}https://stackoverflow.com/questions/11534411
复制相似问题