简体   繁体   English

按钮周围有一个奇怪的边框,我该如何摆脱它?

[英]Button has a weird border around it, how do I get rid of it?

Here is how it looks from my source files这是我的源文件中的样子

And here is how it looks from where it is hosted这是从托管位置看它的样子

Obviously alot wrong with it but the one thing I'm most worried about is that border around the blue button.显然它有很多错误,但我最担心的一件事是蓝色按钮周围的边框。

Here's the HTML code for each button.这是每个按钮的 HTML 代码。

Blue Button蓝色按钮

<a href="#" ><button  class="btn" type="button">View The Line Up</button></a>

Grey Button灰色按钮

<a href="#" ><button  class="btn2" type="button">View The Line Up!</button></a>

and the CSS.和 CSS。

Blue Button蓝色按钮

.btn {

  -webkit-border-radius: 28;
  -moz-border-radius: 28;
  border-radius: 28px;
  font-family: Arial;
  color: #ffffff;
  font-size: 14px;
  background: #358cb1;
  padding: 10px 30px 10px 30px;
  text-decoration: none;
  float: left;
  margin-top: 20px;
}

.btn:hover {
  background: #3cb0fd;
  text-decoration: none;
}

Grey Button灰色按钮

.btn2 {
  -webkit-border-radius: 31;
  -moz-border-radius: 31;
  border-radius: 31px;
  font-family: Arial;
  color: #000000;
  font-size: 14px;
  padding: 10px 30px 10px 30px;
  border: solid #000000 1px;
  text-decoration: none;
  float: left;
  margin-top: 20px;
  margin-left: 20px;
}

.btn2:hover {
    background: #acb0b3;
  text-decoration: none;
}

If you want a solid, single-colour border, then:如果您想要纯色单色边框,则:

border-style: solid;

It looks like it's set to something like inset or outset which are meant to create a quasi-3D effect, Windows 98-style.看起来它被设置为insetoutset类的东西,旨在创建 Windows 98 风格的准 3D 效果。

If you don't want any border at all, then:如果你根本不想要任何边框,那么:

border: 0;

I'm not sure what do you want exactly but why are you wrapping an <a> tag around a <button> ?我不确定你到底想要什么,但你为什么要在<button>周围包裹一个<a>标签? try this as in this JS Fiddle在这个JS Fiddle 中试试这个

<a href="" class="btn">View The Line Up</a>
<a href="" class="btn2">View The Line Up!</a>

border:none; will get rid of the border.将摆脱边界。

As an aside, having a button inside of a link sounds redundant.顺便说一句,在链接内有一个按钮听起来是多余的。 Why not style the link instead (and apply display:inline-block; )?为什么不设置链接样式(并应用display:inline-block; )?

<a href="#" class="btn">My button text</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM