What's the difference between div and & gt;div?
Today, I will talk to you about the difference between div and>div. Many people may not know much about it. In order to let you know more, Xiaobian summarized the following contents for you. I hope you can gain something according to this article.
The difference between the two: for example, div span gets all the span elements under div, while div>span gets the span elements at the first level under div.
The sample code is as follows:
XML/HTML Code Copy content to clipboard
$(document).ready(function () { $("div span").css("font-size", "20px"); //$("div>span").css("font-size","20px"); });
Blog Park 1
Blog Park 2 Blog Park 3
The result is that all span elements become 20px.
XML/HTML Code Copy content to clipboard
$(document).ready(function () { //$("div span").css("font-size", "20px"); $("div>span").css("font-size","20px"); });
Blog Park 1
Blog Park 2 Blog Park 3 After reading the above, do you have any further understanding of the difference between div and>div? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.