Css 链接按钮样式

Css 链接按钮样式,css,linkbutton,Css,Linkbutton,我正在C#.net中制作工作簿创建者(使用visual studio) 本书由正文部分和问题部分组成 该问题的所有答案都在文本中,用户需要单击正确的答案。 如果他是对的,这个词就会变成绿色,如果他错了,这个词就会变成红色 我用这个链接按钮,我需要它没有和“链接”的风格 我将此代码用于问题部分: public class question { public void createQusetion(Panel leftside, string text, string question,strin

我正在C#.net中制作工作簿创建者(使用visual studio)

本书由正文部分和问题部分组成

该问题的所有答案都在文本中,用户需要单击正确的答案。 如果他是对的,这个词就会变成绿色,如果他错了,这个词就会变成红色

我用这个链接按钮,我需要它没有和“链接”的风格

我将此代码用于问题部分:

public class question
{

public void createQusetion(Panel leftside, string text, string question,string answer)
{
    string[] Qbuttonstext = text.Split(' ');
    for (int i = 0; i < Qbuttonstext.Length; i++)
    {
        LinkButton answerButton = new LinkButton();
        if (Qbuttonstext[i] == answer)
        {
            answerButton.ID = "answer";
        }
        else
        {
            answerButton.ID = "word" + i.ToString();
        }
        answerButton.Text = Qbuttonstext[i].ToString()+" ";
        answerButton.CssClass = "textbuttonB4";

   answerButton.Click += new EventHandler(checkAnswer);

     leftside.Controls.Add(answerButton);
    }


}
}
当代码运行时,文本仍然显示为链接

在网上寻找解决方案后,不知道为什么它不起作用

对不起,这个问题的前一个版本


尽快检查输出源。按钮是否具有相应的类?您是否记得包含样式表


还有,
样式:无做什么?这是无效的CSS。

您的问题没有解释您使用的工具。而且,“因为某种原因它不起作用”告诉我们什么。我同意内森的观点。请添加一个测试用例或提供更多信息。很抱歉,我已更改了问题。谢谢“风格:无”是个错误。我查看了源代码,类还可以,样式表也包括在内。所有其他CSS样式都在工作。您希望它做什么?从我所看到的,
:link
:visted
:hover
的样式完全相同,我在您的后端代码中没有看到任何更改。谢谢大家的评论,我已经通过从类声明中删除“a:link”解决了这个问题。谢谢大家
.textbuttonB4 a:link
{
   style:none;
   color:Black;
   font-size:18px;
   border-bottom-style:none;
   background-color:transparent;
   text-decoration: none;
}
.textbuttonB4 a:hover
{
  style:none;
   color:Black;
   font-size:18px;
   border-bottom-style:none;
   background-color:transparent;
   text-decoration: none;
}
.textbuttonB4 a:visited
{
    style:none;
   color:Black;
   font-size:18px;
    border-bottom-style:none;
    background-color:transparent;
    text-decoration: none;

}