带有显示块的超链接不能水平对齐
Hyperlinks with display block cannot be horizontally aligned
我有一堆超链接,我想在 td.The 中水平对齐,问题是它们对齐 vertically.Is 因为我正在使用
display : block;
我知道我应该使用 ul、li 等,但如果我不想使用怎么办?所以帮我 here.I 只是想并排对齐这些超链接。
我的 CSS :
.homehyperlink {
width:90px;
height:50px;
color:#CCCCCC;
text-align:center;
line-height: 50px;
display: block;
font-size: large;
font-weight: 700;
font-family:'Palatino Linotype';
}
.homehyperlink:hover {
width:90px;
height:50px;
color:#FFFFFF;
text-align:center;
line-height: 50px;
display: block;
background-color:#FB2020;
font-weight:bolder;
font-family:'Palatino Linotype';
}
.homehyperlink:active {
width:90px;
height:50px;
color:#FFFFFF;
text-align:center;
line-height: 50px;
display: block;
background-color:#FB2020;
font-weight:bolder;
position: relative;
top: 1px;
font-family:'Palatino Linotype';
}
.munmaintable1234 {
text-align:left;
background-color: #333333;
height:50px;
}
以下是我如何安排它们的链接:
<td class="munmaintable1234" colspan="4">
<asp:HyperLink ID="HyperLink4" runat="server" class="homehyperlink" NavigateUrl="~/test.aspx">HOME</asp:HyperLink>
<asp:HyperLink ID="HyperLink1" runat="server" class="homehyperlink" NavigateUrl="~/test.aspx">HOME</asp:HyperLink>
<asp:HyperLink ID="HyperLink2" runat="server" class="homehyperlink" NavigateUrl="~/test.aspx">HOME</asp:HyperLink>
<asp:HyperLink ID="HyperLink3" runat="server" class="homehyperlink" NavigateUrl="~/test.aspx">HOME</asp:HyperLink>
</td>
改变
display:block
到
display :inline-block
在
.homehyperLink
我有一堆超链接,我想在 td.The 中水平对齐,问题是它们对齐 vertically.Is 因为我正在使用
display : block;
我知道我应该使用 ul、li 等,但如果我不想使用怎么办?所以帮我 here.I 只是想并排对齐这些超链接。
我的 CSS :
.homehyperlink {
width:90px;
height:50px;
color:#CCCCCC;
text-align:center;
line-height: 50px;
display: block;
font-size: large;
font-weight: 700;
font-family:'Palatino Linotype';
}
.homehyperlink:hover {
width:90px;
height:50px;
color:#FFFFFF;
text-align:center;
line-height: 50px;
display: block;
background-color:#FB2020;
font-weight:bolder;
font-family:'Palatino Linotype';
}
.homehyperlink:active {
width:90px;
height:50px;
color:#FFFFFF;
text-align:center;
line-height: 50px;
display: block;
background-color:#FB2020;
font-weight:bolder;
position: relative;
top: 1px;
font-family:'Palatino Linotype';
}
.munmaintable1234 {
text-align:left;
background-color: #333333;
height:50px;
}
以下是我如何安排它们的链接:
<td class="munmaintable1234" colspan="4">
<asp:HyperLink ID="HyperLink4" runat="server" class="homehyperlink" NavigateUrl="~/test.aspx">HOME</asp:HyperLink>
<asp:HyperLink ID="HyperLink1" runat="server" class="homehyperlink" NavigateUrl="~/test.aspx">HOME</asp:HyperLink>
<asp:HyperLink ID="HyperLink2" runat="server" class="homehyperlink" NavigateUrl="~/test.aspx">HOME</asp:HyperLink>
<asp:HyperLink ID="HyperLink3" runat="server" class="homehyperlink" NavigateUrl="~/test.aspx">HOME</asp:HyperLink>
</td>
改变
display:block
到
display :inline-block
在
.homehyperLink