私は、地球上で単純なことになると思ったことをやろうとしています。このボックス内に表示しようとしていた画像の一部をカバーすることを想定したグラフィック要素を含むpngボックスがあります(これは製品ボックスであり、グラフィック要素は値札をシミュレートすることになっています)。
そのため、ボックスが必要で、asp:ImageButtonを使用してその下に画像を表示したいと思いました。
私はこれに何時間も苦労していて、divや画像などを入れようとしています。zオーダーでさまざまなことを試しましたが、成功しませんでしたが、製品の画像はまだグラフィックボックスの上に表示されています。しかし、それがうまく機能している価格に足を踏み入れてください。
私はこれがうまくいくはずだと思った:
<div id="HPItemBox">
<div id="HPItemPriceBox">
<asp:Label ID="lblPrice" runat="server" CssClass="HPItemPrice"></asp:Label>
</div>
<div id="imgBox" runat="server" class="HPimgBox">
<asp:Image ID="ibImage" runat="server" Width="140" Height="140" style="position: relative; z-index: 10;" />
<div id="HPItemLink">
<asp:LinkButton ID="lbToBuy" runat="server" CssClass="ItemURLStyle" OnClientClick="aspnetForm.target ='_blank';">Buy it</asp:LinkButton>
</div>
</div>
</div>
また試した:
<div id="HPItemBox">
<div id="HPItemPriceBox">
<asp:Label ID="lblPrice" runat="server" CssClass="HPItemPrice"></asp:Label>
</div>
<div id="imgBox" runat="server" class="HPimgBox">
<div id="divImage" runat="server" style="position: relative; width: 140px; height: 140px;
z-index: 10;">
</div>
<div id="HPItemLink">
<asp:LinkButton ID="lbToBuy" runat="server" CssClass="ItemURLStyle" OnClientClick="aspnetForm.target ='_blank';">Buy it</asp:LinkButton>
</div>
</div>
</div>
cssがあります:
#HPItemBox
{
position: relative;
width: 190px;
height: 190px;
background-image: url('../images/home-product-box.png');
background-repeat: no-repeat;
background-color: #ffffff;
float: left;
z-index: 50;
}
.HPItemPrice
{
font-family: Arial;
font-size: 12px;
font-weight: bold;
color: #4d4d4d;
}
.HPimgBox
{
position: relative;
top: -10px;
right: 20px;
width: 170px;
z-index: 10;
}
何か案は?よろしくお願いします。