CSS明显比XPATH更性感!CSS再学一点儿

发布时间:2024年01月20日

在selenium应用,CSS比XPATH更性感

在这里插入图片描述
To style an element, Front end developers need to locate the element first and then apply styling rules. It looks like this:

#logo{ color: white; background: black; }

That CSS snippet says, apply color and background styles to any element with an ID of logo. Normally, ID will be unique in any HTML document carefully crafted. But there are chances for multiple developers working on the same page to use the same ID for different elements. Most of the time, without knowing it is already being used. Don’t worry, they’ll eventually catch up with that bug, but the point is the browser throws no warning. You should tell the developers when you find such scenarios.

The JavaScript developer who wants to take the logo for a spin writes code like this:

let element=document.querySelector(“#logo”); rotate(element);

文章来源:https://blog.csdn.net/longwo888/article/details/135722631
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。