Google Chrome copy CSS Path in Developer Tools
Chrome has updated this option
In chrome after recent update this option has been changed from(right click on the element in Elements Window) > Copy CSS path
to :(right click on the element in Elements Window) > Copy > Copy selector
How can I get the CSS Selector in Chrome?
Although not an extension, I did find a bookmarklet called Selector Gadget that does exactly what I was looking for.
Web Developer mode in Chrome or Firefox: how to get an object's CSS full selector?
Right-click the element in the inspector, choose the Copy submenu, and each browser gives you slightly different options:
Chrome (and other Chromium-based browsers including the new Microsoft Edge) gives you the option to copy the selector, which produces a somewhat optimized but still fairly long selector that will uniquely identify the element.
Firefox gives you two options: "CSS Selector" that functions mostly the same as Chrome but gives you a much more optimized selector, and "CSS Path" that gives you the same as what you're pointing to in your screenshot, the entire path to that element starting from the root. "CSS Path" is designed for web testing tools but it's probably excessive for most other use cases, which I'm guessing is why Chrome doesn't have a similar feature.
Check out these other answers in which I explain a bit more how these features work:
- How does Chrome dev tools generate CSS selectors?
- Chrome Dev Tools CSS selectors Method
Related Topics
Is It the Last 'Script' Element the Currently Running Script
How to Set a JavaScript Onclick Event to a Class with CSS
Dynamically Changing Stylesheet Path Not Working in Ie and Firefox
Wrap Text Inside Fixed Div with CSS or JavaScript
Highlighting the Clicked Row of a Striped HTML Table
How to Get a Dom Element's ::Before Content with JavaScript
Set a Font Specifically for All Numbers on the Page
Fastest Selector Method in Jquery and CSS - Id or Not
Typical Pitfalls of Cross-Browser Compatibility
Getelementbyclass().Setattribute Doesn't Work
Duplicating an Element (And Its Style) with JavaScript
Apply Random Color to Class Elements Individually
Using Media Queries to Only Include Js Files on Mobile
How to Position a Bootstrap Popover
Changing CSS Variables via Js in Polymer
Is It Normal to Have Two Elements with Same Id in Two Div Elements with Other Id