Difference between #id and div#id

后端 未结 9 1812
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-22 04:52

I am new to css. Can someone help me in differentiating \"#test\" and \"div#test\"?

9条回答
  •  被撕碎了的回忆
    2020-12-22 05:35

    #test will take the element with the id test while div#test will only take the div with an id named test. This doesn't make a great difference since ids have to be unique.

    This kind of info is pretty easy to find, you may want to take a look at W3schools documentation

提交回复
热议问题