當我想將我的一種CSS樣式應用於asp標籤時,我有一個特殊的結果。樣式實際上只有部分效果,例如像background-color
這樣的屬性,顏色正在起作用,而寬度和高度不起作用。我不明白爲什麼。無法將CSS樣式應用於一個asp標籤
ASP
<div id="wrap">
<div id="left" class="Tablestyle">
<asp:Label ID="Label1" runat="server" Text="Entry Number: " class="Tablestyle"></asp:Label>
<br /><div class="separator"> </div>
<asp:Label ID="Label3" runat="server" Text="ID Number: " class="Tablestyle"></asp:Label>
<br /><div class="separator"> </div>
<asp:Label ID="Label2" runat="server" Text="Type: " class="Tablestyle"></asp:Label>
</div>
<div id="Mid"> </div>
<div id="right">
<asp:Label ID="IdBox" runat="server" class="TableStyleInfo"></asp:Label>
<br /><div class="separator"> </div>
<asp:Label ID="IdNumBox" runat="server" class="TableStyleInfo"></asp:Label>
<br /><div class="separator"> </div>
<asp:Label ID="TypeBox" runat="server" class="TableStyleInfo"></asp:Label>
</div>
</div>
CSS
#wrap
{
width:555px;
margin:auto;
text-align:center;
}
#Mid
{
width:5px;
height:330px;
float:left;
background-color:White;
}
#right
{
width:400px;
float:left;
text-align:left;
background-color:Yellow;
}
#left
{
width:150px;
float:left;
text-align:right;
background-color:Green;
}
.separator
{
height:4px;
line-height:4px;
background-color:White;
}
.Tablestyle
{
width:150px;
height:20px;
text-align:right;
color:white;
font-weight:bold;
background-color:#507CD1;
}
.TableStyleInfo
{
width:400px;
height:20px;
text-align:left;
color:Black;
background-color:#EFF3FB;
}
我試着也在發生變化class
到CssClass
但什麼也沒發生一樣。
如果有人能指出我的錯誤或給我提示,爲什麼我不能應用寬度和高度屬性,我將不勝感激。
我有一些改進。我將float:left添加到適用於asp標籤的類TableStyle和TableStyleInfo中。現在itgets正確的寬度,但'separator' divs不可見=( – meks