0

我的网站即将完成http://csgoshack.com/shop/

我需要做一件事,就是在屏幕中央放一个白框,这样我就可以看到该站点。

我试图通过在背景图像上添加一个白框来做到这一点,但这没有用。

我该怎么做呢?

.whitebg {
width: 1250px;
padding: 10px;
border: 1px solid black;
margin: 0;
background-color:#ffffff;
margin:auto;
position: absolute-center;
top:0;
}
4

1 回答 1

0

首先,您需要使用 CSS 设计您的盒子并使用 HTML 调用它。

HTML:

<div class="body-content">Insert Lists, Text, and other body content here</div>

CSS:

.body-content {
    width:80%;
    height:80%;
    top:10%;
    position:absolute;
    background-color: white;
    margin-left:auto;
    margin-right:auto;
}

根据您的规格调整宽度、高度、位置和颜色。我不会更改左右边距,因为这会使 div 在主体内部居中(除非您不希望它完全居中)。

希望这有帮助!

于 2015-02-11T23:19:21.323 回答