简体   繁体   English

CSS / HTML:背景图片重复Y错误

[英]CSS/HTML : Background image Repeat-Y error

Hi please take a look for better understanding . 嗨,请看一下以便更好地理解

Here background repeat-x is rendering smoothly while background repeat-Y renders with break. 在这里,背景repeat-x平滑渲染,而背景repeat-Y带有断点渲染。

<html> <head>
<style type="text/css">
.dark {
    width: 100%;
    height: 100%;
    background: white url('images/button_darkgrey_TPLinux_110x80.jpg');
    background-repeat: repeat;

 }
</style> </head>

< body>
  <div style="width: 500px; height: 350px; z-index: 1">
        <input type="button" class="dark" value="7"/>
  </div>
</body> </html>

What you can do is set your background image and an image tag <img class='dark' src="img.jpg" /> and give it the following css so it acts like a background. 您可以做的是设置背景图像和图像标签<img class='dark' src="img.jpg" />并给其以下css,使其像背景一样工作。

.dark{
  position:absolute;
  z-index:-1;
  width:100%;
  height:100%;
}

Check working example at http://jsfiddle.net/P4rrP/1/ http://jsfiddle.net/P4rrP/1/上查看工作示例

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

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