0

代码:

<style>
    .RoundButton
    {
      text-align: center;
      text-decoration: none;
      font-size: 34px;
      width: 70px;
      height: 40px;
      background-color: #ffffff;
      border-radius: 15px;
      -moz-border-radius: 15px;
      -webkit-border-radius: 15px;
      border: 5px solid #000000;
      padding: 5px;
    }
    .RoundButton:link {color: #000000;}
    .RoundButton:visited {color: #000000;}
    .RoundButton:hover {color: #000000;border: 5px solid #ff0000;}
    .RoundButton:active {color: #000000; border: 5px solid #0000ff;}
</style>

然后我有一些HTML:

<center><a href="https://www.google.com" target="blank"><div class="RoundButton">Hi</div></a></center>

当我查看它时,它显示默认链接颜色,但圆形按钮更改颜色有效。我查看了 W3Schools,他们的示例看起来像我的,但有效。帮助?

4

3 回答 3

2

请让你的问题更具体。你的造型有什么问题?

于 2013-11-13T03:00:32.267 回答
0

然后将 .RoundButton:hover 更改为 a:hover {} 为您喜欢的任何内容。

于 2013-11-13T03:07:25.540 回答
0

的HTML:

<div class="RoundButton"><a href="https://www.google.com" target="blank">Hi</a></div>

CSS

.RoundButton
{
  text-align: center;
  text-decoration: none;
  font-size: 34px;
  width: 70px;
  height: 40px;
  background-color: #ffffff;
  border-radius: 15px;
  -moz-border-radius: 15px;
  -webkit-border-radius: 15px;
  border: 5px solid #000000;
  padding: 5px;
  margin:0 auto;
}
.RoundButton:hover {color: #000000;border: 5px solid #ff0000;}
.RoundButton:active {color: #000000; border: 5px solid #0000ff;}
a:link {color: #000000;}
a:visited {color: #000000;}

小提琴。_

margin:0 auto我使用而不是<center>标签使 div 居中,并调整了 CSS。

于 2013-11-13T03:07:35.423 回答