id selector
id selector is introduced using "#", which has the same effect as the "." of the class selector. Example: #div{} Let's do a specific experiment: html:
认识html标签 勇气
三年级时,我还是一个胆小如鼠的小女孩,上课从来不敢回答老师提出的问题,生怕回答错了老师会批评我。就一直没有这个勇气来回答老师提出的问题。学校举办的活动我也没勇气参加。
到了三年级下学期时,我们班上了一节公开课,老师提出了一个很简单的问题,班里很多同学都举手了,甚至成绩比我差很多的,也举手了,还说着:"我来,我来。"我环顾了四周,就我没有举手。
css:
#stress{ color:red; }
Rendering:
In many ways, ID selectors are similar to class selectors, but There are also some important differences:
1. Set id="ID name" for the label instead of class="class name".
2. The ID selector is preceded by a pound sign (#) instead of an English dot (.).