css - 为什么这个按钮会导致我的布局被破坏?

标签 css button

我修改了这个 CSS 按钮以放在我公司的网站上,但每次我尝试实现它时,都会导致整个网站失去中心对齐。

这是 HTML:

<div id="contain">
<button class="support"> </button>

这是 CSS:

    button.support {
background: rgb(38,128,195); /* Old browsers */
background: -moz-linear-gradient(top, rgba(38,128,195,1) 11%, rgba(30,101,155,1) 99%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(11%,rgba(38,128,195,1)), color-stop(99%,rgba(30,101,155,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(38,128,195,1) 11%,rgba(30,101,155,1) 99%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(38,128,195,1) 11%,rgba(30,101,155,1) 99%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(38,128,195,1) 11%,rgba(30,101,155,1) 99%); /* IE10+ */
background: linear-gradient(to bottom, rgba(38,128,195,1) 11%,rgba(30,101,155,1) 99%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2680c3', endColorstr='#1e659b',GradientType=0 ); /* IE6-9 */
border-top: 1px solid #38538C;
border-right: 1px solid #1F2D4D;
border-bottom: 1px solid #151E33;
border-left: 1px solid #1F2D4D;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow:  0 6px 0px #1F3053, 0 8px 4px 1px #111;
-moz-box-shadow: 0px 1px 0 #1d2c4d, 0 6px 0px #1f3053, 0 8px 4px 1px #111111;
box-shadow: 0px 1px 0 #1D2C4D, 0 6px 0px #1F3053, 0 8px 4px 1px #111;
color: white;
font: bold 20px "helvetica neue", helvetica, arial, sans-serif;
line-height: 1;
margin-bottom: 10px;
padding: 10px 0 12px 0;
text-align: center;
text-shadow: 0px -1px 1px #1E2D4D;
height: 175px;
width: 175px;
-webkit-background-clip: padding-box;
transition: all 200ms;
-moz-transition: all 200ms; /* Firefox 4 */
-webkit-transition: all 200ms; /* Safari and Chrome */
-o-transition: all 200ms; /* Opera */
}

button.support:hover {
    -webkit-box-shadow: inset 0 0px 20px 1px #87adff, 0px 1px 0 #1d2c4d, 0 6px 0px #1f3053, 0 8px 4px 1px #111111;
    -moz-box-shadow: inset 0 0px 20px 1px #87adff, 0px 1px 0 #1d2c4d, 0 6px 0px #1f3053, 0 8px 4px 1px #111111;
    box-shadow: inset 0 0px 20px 1px #87adff, 0px 1px 0 #1d2c4d, 0 6px 0px #1f3053, 0 8px 4px 1px #111111;
    cursor: pointer; }

  button.support:active {
    -webkit-box-shadow: inset 0 1px 10px 1px #5c8bee, 0 1px 0 #1d2c4d, 0 2px 0 #1f3053, 0 4px 3px 0 #111111;
    -moz-box-shadow: inset 0 1px 10px 1px #5c8bee, 0 1px 0 #1d2c4d, 0 2px 0 #1f3053, 0 4px 3px 0 #111111;
    box-shadow: inset 0 1px 10px 1px #5c8bee, 0 1px 0 #1d2c4d, 0 2px 0 #1f3053, 0 4px 3px 0 #111111;
    margin-top: 4px; }
​

我尝试将其从输入更改为超链接,但它没有改变任何内容,一旦我添加 CSS 代码,它就会撤消页面上的所有水平对齐。不过,我没有看到任何会扰乱它的东西。

它以某种方式摆脱了#site div。我不确定为什么要这样做......

这是我尝试在其上实现它的页面:http://bluebeam.com/us/support/

最佳答案

我知道这个问题已经解决了,但这就是您遇到此问题的原因:CSS 上最后一个右大括号后面有一个不可见的特殊字符,特别是零宽度空格 ( U+200B )。

关于css - 为什么这个按钮会导致我的布局被破坏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12203376/

相关文章:

html - CSS - 水平滚动菜单不滚动

html - 表单内的图像按钮,不想提交

wpf 按钮背景悬停颜色

python - 如何在 Mac OS X 上更改 Tkinter 按钮的前景色或背景色?

html - css animation+transition 每 10 秒触发一次并且在悬停时触发

html - 溢出文本左对齐

css - 背景:透明不起作用

html - 图片 :hover not working in ie

javascript - "Add to favourites"更改类和 innerHTML 的按钮

html - Paypal 运输下拉默认方法