引导程序:点击<a>-tag

时间:2018-09-29 16:25:11

标签: css firefox button twitter-bootstrap-3

I'm using twitter bootstrap (v3.3.7) and the following button was displayed just fine:

<a href="#" onclick="loadContent(...); return false;" class="btn btn-primary">Open</a>

After clicking on a link like this

<a href="somefile.pdf" target="_blank">File</a>

the font-color of the button turns black. Reloading does not help, i have to delete all history data, cache etc. This problem occurs in Firefox and Chrome, but not in Safari.

Does anybody have an idea what could cause this problem? I hope it's possible to fix this without overriding the styles of the button.

EDIT to clarify: the second link is not the same as the first one. So the style of the first button (a styled a-tag) changes after clicking on an other a-tag. In the developer tool it says that the font of the first button should be black, but it is white and therefore invisible, as the button is white, too.

1 个答案:

答案 0 :(得分:0)

不覆盖按钮的样式是不可能的。您看到的是a:visited在工作。您需要重写此CSS规则,使其与未访问的a相同,以使链接在之前和之后看起来都一样。