Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.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中指定的不同?_Css - Fatal编程技术网

为什么元素的高度和宽度与CSS中指定的不同?

为什么元素的高度和宽度与CSS中指定的不同?,css,Css,为什么元素的高度和宽度与CSS中指定的不同 这是指向JSFIDLE的链接 相同的代码被复制粘贴在这里 HTML <!DOCTYPE html> <html> <body> <div id="target"> <p>Click here set promise as Done!</p> </div> <br/> <div id="reset" ><p>Reset<

为什么元素的高度和宽度与CSS中指定的不同

这是指向JSFIDLE的链接

相同的代码被复制粘贴在这里

HTML

<!DOCTYPE html>
<html>
<body>  
<div id="target">
  <p>Click here set promise as Done!</p>
</div> 
<br/>
<div id="reset" ><p>Reset</p></div>  
</body>
</html>
添加“px”->

  width:200px;
  height:200px;
添加“px”->

  width:200px;
  height:200px;

您需要为CSS中的任何测量值指定单位(px,em,%):

#target {
  width:200px;
  height:200px;
  background-color:yellow;
}

您需要为CSS中的任何测量值指定单位(px,em,%):

#target {
  width:200px;
  height:200px;
  background-color:yellow;
}