【问题标题】:HyperlinkField in Gridview not showing blue underline for linksGridview 中的 HyperlinkField 未显示链接的蓝色下划线
【发布时间】:2011-04-20 11:18:01
【问题描述】:

我在 Gridview 控件中有一个超链接字段。我正在为 gridview 使用下面显示的样式表。 但是由于某种原因,gridview中的hyperlinkField列不是蓝色的,也没有下划线。

如何将超链接显示为蓝色和下划线的常规超链接?

谢谢

/* table style */
table.BlueGridView
{

    font-family:helvetica,arial,sans-serif;
    border:solid 1px #7aa5d6;

    text-align: left;
    font-size: 10pt;

    /*position:fixed; */
    display:inline-block;
    vertical-align: baseline;
    direction: ltr;
    letter-spacing: normal;
}

/* header cell style */
.BlueGridView th
{
    color:#3366cc;
    border-right-color:#7aa5d6;
    border-bottom-color:#7aa5d6;
    background:#e5ecf9;
}  

/* cell styles */
.BlueGridView td
{
    border-bottom-color:#e5ecf9;    
    border-right-color:#e5ecf9; 
}

/* mouseover row style */
.BlueGridView .row-over 
{ 
    background-color:#e5ecf9;
}
/* Alternating Row Color */
.BlueGridView .alt-data-row 
{ 
    background-color:#e5ecf9;
    font-weight:normal;
    font-family:Verdana;
    font-size:small; 

}

.BlueGridView .data-row
{
    font-weight:normal;
    font-family:Verdana;
    font-size:small; 
}

.BlueGridView .selected-row
{
    background-color:Blue;  
}

/* GridView Header */
.BlueGridView .header-row
{
    color: #000080;
    font-weight: bold;
    text-align:center; 
    /* position:relative; */



}

/* mouse select row style */
.BlueGridView .row-select 
{ 
    background-color:#7aa5d6;
    color:#fff;
}

【问题讨论】:

  • 你也应该发布你的 GridView 代码,否则真的很难分辨出哪里出了问题。
  • 使用 FireBug 确定哪些 CSS 规则最后应用

标签: asp.net gridview asp.net-3.5


【解决方案1】:

在没有看到您的整个样式表和 GridView 代码的情况下,这是我能给您的最佳答案。

.BlueGridView * a
{
    text-decoration:underline !important;
    color: #0000F5 !important;
}

这会影响 .BlueGridView 中的所有标签...因此,如果您有其他超链接,请更具体地使用选择器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-02-16
    • 1970-01-01
    • 2022-09-23
    • 2013-11-01
    • 2014-07-09
    相关资源
    最近更新 更多