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
无法更改html的宽度_Html_Css - Fatal编程技术网

无法更改html的宽度

无法更改html的宽度,html,css,Html,Css,我是html新手,这是我正在做的作业。当我将绿色框的宽度设置为50%或30px时,它的宽度不会改变。有人知道如何解决这个问题吗 .topcorner { position: absolute; top:0; right:0; border: 1px solid black; text-align: center; width: 50%; height: 50%; } 解决方案1 更改css中内容处项目1的宽度 #content { width: 50%; b

我是html新手,这是我正在做的作业。当我将绿色框的宽度设置为50%或30px时,它的宽度不会改变。有人知道如何解决这个问题吗

.topcorner {
  position: absolute;
  top:0;
  right:0;
  border: 1px solid black;
  text-align: center;
  width: 50%;
  height: 50%;
}

解决方案1

更改css中内容处项目1的宽度

#content {
  width: 50%;
  background-color: #90EE90; /* green */
} 
解决方案2

从内容中删除宽度属性

#content {
  background-color: #90EE90; /* green */
}

阅读有关选择器的更多信息

解决方案1

更改css中内容处项目1的宽度

#content {
  width: 50%;
  background-color: #90EE90; /* green */
} 
解决方案2

从内容中删除宽度属性

#content {
  background-color: #90EE90; /* green */
}
阅读有关选择器的更多信息