Home  >  Q&A  >  body text

在写样式的时候,后面的 } 没有写,为啥没有效果?

<!DOCTYPE html>
<html>
<head>
	<title></title>
	<style type="text/css">
		h2{color:red;
	</style>
</head>
<body>
	<h3>hello world</h3>
</body>
</html>


素颜素颜2861 days ago1023

reply all(3)I'll reply

  • 数据分析师

    数据分析师2017-09-30 22:53:15

    When writing the style, the following } is not written. Why is there no effect? -PHP Chinese website Q&A-When writing styles, the following } is not written, why does it have no effect? -PHP Chinese website Q&A

    Please watch and learn.

    reply
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2016-12-19 11:52:08

    属性(property)是您希望设置的样式属性(style attribute)。每个属性有一个值。属性和值被冒号分开。要使用花括号来包围声明。1476339183895667.png你这个是格式错误,所以代码不会有效果显示。

    reply
    1
  • 迷茫

    迷茫2016-12-19 11:48:32

    html毕竟不是语言,没有那么严谨,所以有些代码错了也不会给你报错,有的只会没有效果,但有的会有效果的,主要还是自己细心

    reply
    1
  • Cancelreply