Choosing what happens when you click on an element
CSS Pro has 3 "on click" modes regarding what happens when you click on an element: Select element, Copy code, and Pin the CSS window.
This mode shows you options of what you can do with an element. When you click on an element, it shows a tooltip with 5 different options and keeps the red guidelines in place:
The options are, in order:
With the options:
- Copy code
- The final result depends on your Settings. But by default, it copies the HTML and CSS code of the element, all its children, and pseudo-classes and pseudo-elements)
- Copy selector
- Copy a general and non-specific CSS selector for the current element.
- Example: "p" or "p.some-class"
- Copy unique selector
- Copy a specific and unique CSS selector that only matches this element on the page.
- Example: "div#rso > div:nth-child(1) > div > div > div > div:nth-child(1) > a > h3 > span"
If you want to see or edit the element's CSS code. This option will pin the CSS window on the screen:
With the options:
- Export element to Codepen (export the HTML and CSS of the element, all its children, and pseudo-classes and pseudo-elements)
- Save element as a file (same as exporting the element to Codepen, but instead of sending it to Codepen, it's exported as a .html file)
Completely removes the element from the DOM (locally and until you refresh the page again).
Sometimes you click on an element by accident. This option lets you cancel the selection.
If your goal is to copy things quickly, this is going to save you time. It's simple: click to copy. The result is the same as selecting "Copy code" on the "Select element" mode.
If this mode is select, whenever you click on an element, it will pin the CSS window of it on the screen so you can edit it.
To change modes, click on the gear icon (Settings) on CSS Pro's top bar, and then find the section "On click" and choose one of the 3 options by clicking on it.