我需要你的帮助
我想知道是否有键盘来确认 DOM 中是否有背景图像,或者是否可以在控制台中显示一些消息,就好像有背景图像说 TRUE 一样。
背景图片在header里,不在div里
背景图片:url(/wp-content/uploads/slider_03-1.jpg);
谢谢!
您可以使用 CSS 选择器并测试此 DIV 是否存在。
div.section[style*='background-image:url(/wp-content/uploads/MainBack-1.jpg);']
^ a DIV
^ that has the class "section"
^ that also contains as part of the style the "background-image..." path
这是为页面主要部分提供背景图像的 DIV。