CSS - 背景渐变不会覆盖整个页面,因为它增长

时间:2015-01-15 18:54:41

标签: css

我有一个带手风琴的页面,当手风琴打开时背景不会填满整个页面。

以下是我到目前为止所尝试的内容。

.models-background {
  /* IE10 Consumer Preview */ 
  background-image: -ms-linear-gradient(top, #666666 0%, #E6E6E6 100%);

  /* Mozilla Firefox */ 
  background-image: -moz-linear-gradient(top, #666666 0%, #E6E6E6 100%);

  /* Opera */ 
  background-image: -o-linear-gradient(top, #666666 0%, #E6E6E6 100%);

  /* Webkit (Safari/Chrome 10) */ 
  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #666666), color-stop(1, #E6E6E6));

  /* Webkit (Chrome 11+) */ 
  background-image: -webkit-linear-gradient(top, #666666 0%, #E6E6E6 100%);

  /* W3C Markup, IE10 Release Preview */ 
  background-image: linear-gradient(to bottom, #666666 0%, #E6E6E6 100%);

  background-size: 100% 100%;

  background-repeat: no-repeat;

  background-size: cover;
}

1 个答案:

答案 0 :(得分:0)

add at the beginning of the CSS code:

{

min-height: 100% ;
min-width: 100% ;

<!-- add your stuff :) -->
}

如果您想参考其他帖子:

previous question 1:缩放渐变 Previous question 2:缩放背景

希望它有所帮助。

相关问题