0

我刚刚设法启动并运行了一个基于 style.css 的网站

CSS 文件代码为

html 
{
    height:100%;
}
{
  position: relative;
  z-index: 0;
  width: 100%;
  left: 0;
  top: 0;
  cursor:default;
  overflow:visible;
}

body
{
  padding: 0; 
  margin:0;
  color: #000000;
  height:100%;
  min-height:100%;
  background-color: #D3D8FD;
  background-image: url('images/Bottom_texture.jpg');
  background-repeat: repeat-x;
  background-attachment: fixed;
  background-position: top center;
  min-width: 820px;
}

.cleared
{
  display:block;
  clear: both;
  float: none;
  margin: 0;
  padding: 0;
  border: none;
  font-size: 0;
  height:0;
  overflow:hidden;
}

我无法理解如何更改此值,因此当在大屏幕上打开页面时,空白空间和 100% 水平拉伸不存在。我只需要页面的实际大小。所以没有留下空白空间。我已经阅读了所有关于 css 的内容,但无法获得合适的代码,因为我不太擅长。

谢谢你。

4

4 回答 4

1

如果我明白你想要做什么......

这应该适用于您拥有的代码,使 html 和 body 100% 高度,但您还需要添加

div#yourdiv { 
  height:100% 
} 

对于您想要占据浏览器窗口的整个 100% 高度的任何 div。

于 2012-08-14T12:10:23.560 回答
0

更新代码,用这个替换你的所有代码:

CSS

{ 
  position: relative; 
  z-index: 0; 
  width: 100%; 
  left: 0; 
  top: 0; 
  cursor:default; 
  overflow:visible; 
}     
body 
{ 
  padding: 0;  
  margin:0; 
  color: #000000; 
  background-color: #D3D8FD; 
  background-image: url('images/Bottom_texture.jpg'); 
  background-repeat: repeat-x; 
  background-attachment: fixed; 
  background-position: top center; 
  min-width: 820px; 
} 
.cleared 
{ 
  display:block; 
  clear: both; 
  float: none; 
  margin: 0; 
  padding: 0; 
  border: none; 
  font-size: 0; 
  height:0; 
  overflow:hidden; 
}

希望这就是你要找的...

于 2012-08-14T12:29:08.507 回答
0

查看页面上的 HTML,您有一个标签,其中包含
检查 html 的第 111 行。

您的文本检查第 113 行右侧还有一个空座位。

这仅适用于主页,但删除它们,您将删除文本之后和页脚之前存在的空白。

于 2012-08-14T13:22:45.997 回答
0

尝试放置:

margin:0px 0px 0px 0px; <---I used this for IE
size: 100%; <---image stretches with any browser
于 2012-08-14T14:13:35.327 回答