【发布时间】:2013-11-19 01:32:17
【问题描述】:
我有一张桌子,那张桌子上有一张图片。图像没有占据所在行的整个高度和宽度。我已将 img 设置为 100% 的宽度和高度,但没有任何效果。下面是我的代码。
<style type="text/css">
.style1
{
background-color: #c1b7a6;
width: 40%;
padding-left: 1.5em;
}
.style2
{
background-color:#7f6d53;
width: 40%;
padding-left: 1.5em;
}
.style3
{
background-color:#5e513d;
width: 40%;
padding-left: 1.5em;
}
.style4
{
outline: #5c492d solid 2px;
width: 100%;
}
.style5
{
border-right: 2px solid #5c492d;
}
.style6
{
padding-left: 1.5em;
}
.style7
{
background-color: #7f6d53;
outline: #5c492d solid 2px;
}
.style8
{
width:100%;
height: 100%;
display: block;
}
.img
{
height:100%;
width: 100%;
}
</style>
<div align="center" >
<table class="style4" cellpadding= "0px" cellspacing= "0px">
<tr>
<td rowspan="3" align="left" valign="top" class="style5" >
<img id="imgMain" src="Images/Logo" class="img" />
</td>
<td align="left" valign="top" class="style1"> <asp:Image ID="imgText" runat="server" />
</td>
</tr>
<tr>
<td align="left" valign="top" class="style2" ><asp:Label ID="lblSum" runat="server" Text="Label" ForeColor="Black"></asp:Label>
</td>
</tr>
<tr>
<td align="left" valign="top" class="style3"> <asp:Label ID="Label5" runat="server" Text="Refine Your Results By"
Font-Names="KozGoPr6n-Bold" ForeColor="#F9B92D"></asp:Label>
<br />
<asp:Button ID="Button1" runat="server" Text="Button" />
</td>
</tr>
</table>
欢迎提出任何建议!
【问题讨论】:
-
您已将
padding设置为单元格。
标签: html css html-table