Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/91.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
Html 我的部门不听我的_Html_Css - Fatal编程技术网

Html 我的部门不听我的

Html 我的部门不听我的,html,css,Html,Css,我的div与另一个div在一起时遇到问题 无论我给它什么位置,div要么跳到页面顶部,要么不显示 CSS: .content { width:100%; background: #F0F0F0; border: 1px solid #CCC; height: 1000px; margin: 0px auto; } .contentinside { postition: relative; margin: auto; width: 960px; height:

我的
div
与另一个
div
在一起时遇到问题

无论我给它什么位置,
div
要么跳到页面顶部,要么不显示

CSS:

.content {
  width:100%;
  background: #F0F0F0;
  border: 1px solid #CCC;
  height: 1000px;
  margin: 0px auto;
}

.contentinside {
  postition: relative;
  margin: auto;
  width: 960px;
  height: 200px;
  background-color:#000099;
}
<div class="content">
<div class="contentinside">something here</div>
HTML:

.content {
  width:100%;
  background: #F0F0F0;
  border: 1px solid #CCC;
  height: 1000px;
  margin: 0px auto;
}

.contentinside {
  postition: relative;
  margin: auto;
  width: 960px;
  height: 200px;
  background-color:#000099;
}
<div class="content">
<div class="contentinside">something here</div>

这里有东西

需要关闭第一个
div
标签

<div class="content"></div>
<div class="contentinside">something here</div>

这里有东西

您需要将第一个div放入另一个div中,如下所示。您缺少第二个div的结尾

<div class="content">
<div class="contentinside">something here</div></div>

这里有东西
试试这个:

.content {
  position: relative;
  /* rest of your styles */
}

.contentinside {
  position: absolute;
  /* rest of your styles */
}
现在.contentinside的定位是相对于.content的。
当然,要正确地检查结束标记、键入等。

除了不关闭content div外,还存在键入错误。应该是position:relative,你有position:relative。你需要在样式中添加
服从:me
。将你的猎枪指向它的大致方向。对周围的几个分区的几次警告射击应该引起它的注意。你能详细说明你想让它做什么吗,可能会展示一把小提琴吗?@varubi他很难说服分区留在另一个分区内。也许起草一份协议书可能会起作用。。。