Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CSS positions元素_Css_Html - Fatal编程技术网

CSS positions元素

CSS positions元素,css,html,Css,Html,小而容易的问题。我有这些CSS规则 html { background-image:url('../images/background1.jpg'); -webkit-background-size: cover; -o-background-size: cover; background-size: cover; } body { font-family: Arial, Helvetica, sans-serif; font-size: 10

小而容易的问题。我有这些CSS规则

html {
    background-image:url('../images/background1.jpg');
    -webkit-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}

body {
    font-family:  Arial, Helvetica, sans-serif;
    font-size: 100%;
    margin-top: 5px;
    margin-left: auto;
    margin-right: auto;
    width: 960px;
    border:  3px solid rgb(75,75,75);
    box-shadow: 0 0 15px 5px rgba(40,80,100,.75);
    -moz-border-radius-bottomleft: 10px;
    border-bottom-left-radius: 10px;
    -moz-border-radius-bottomrightt: 10px;
    border-bottom-right-radius: 10px;
    background:url('../images/background4.jpg');
    background-size: cover;
    min-height: 900px;
    height:auto;
}
现在我只想添加侧面,不是主体,而是相对位置的广告框。。。我该怎么做?
提前感谢

如果您想在正文的两侧添加额外的内容,您需要做的是指定3个
元素,将它们分别设置为页面的宽度(如果您想在主区域的每一侧做广告,您可以使用css width属性为每个div设置百分比,或者如果您想要精确的测量值,可以以像素为单位进行设置

将第二个“中间”div作为新的“body”,在那里你将有你的内容


这有意义吗?

你的身体必须拥有一切。如果你想实现一个三柱结构,中间是身体目前的样子,侧面有两个位置,你可以这样做

<div id="wrapper">
    <div id="left"></div>
    <div id="main"></div>
    <div id="right"></div>
</div>

下面是一个我认为您想要的示例,它使用
html
css


网页上所有可见的内容都在正文中。不清楚你所说的“边,而不是正文”是什么意思。如果你能提供你想要的图片,可能会有所帮助。我注意到当我用css编辑html规则时……我得到了正文960px中没有的%,现在在960px的范围之外,我想添加广告框。
#wrapper {width: 100%;}
#left {width: 15%; float: left;}
#right {width: 15%;float:left;}