按钮按下背景图像

时间:2017-06-23 11:36:48

标签: css twitter-bootstrap

我有这个html页面

  <body>

  <a href="app.html" class="btn btn-primary go">Go</a>

  </body>

有背景图片

<style>

     html { 
  background: url(img/mobile.fw.png) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
    }
    .go{
    z-index:1 !important;
    margin-top:40%;
    }
    </style>

我的页面存在的问题是当我按下按钮时它会按下背景图像。如何才能让按钮没有按下背景?。

2 个答案:

答案 0 :(得分:0)

它对我来说很好。我测试了它

&#13;
&#13;
     html { 
	background: url(https://images7.alphacoders.com/602/thumb-1920-602691.jpg) no-repeat center center fixed; 
	-webkit-background-size: cover;
	-moz-background-size: cover;
	-o-background-size: cover;
	background-size: cover;
    }
    .go{
    z-index:1 !important;
    margin-top:40%;
    }
&#13;
 <body>

  <a href="app.html" class="btn btn-primary go">Go</a>

  </body>
&#13;
&#13;
&#13;

答案 1 :(得分:0)

你想要这样的东西吗?

&#13;
&#13;
html { 
  background: url(http://lorempixel.com/400/200) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}
.go{
  
  margin-top:40%;
  background: white;
  border: solid 2px black;
}
&#13;
 <body>

  <button href="app.html" class="btn btn-primary go">Go</button>
&#13;
&#13;
&#13;

希望有所帮助