# Copying CSS and HTML

### Copying child elements' CSS:

With CSS Pro, you can copy the CSS of the selected element and all its child elements. This can be turned on and off anytime at More > Settings > Child elements' CSS:

![](/files/zOa3onRk30C8h64wTQNl)

### Copying pseudo-classes pseudo-elements and media queries styles:

CSS Pro automatically copies all pseudo-classes such as `:hover`, `:active`, `:focus`, etc, and pseudo-elements such as: `:before`, `:after`, etc, **along with all media queries** automatically.

### Copying CSS variables:

CSS Pro automatically copies all CSS variables.

### HTML Code:

It's also possible to copy HTML code along with the CSS:

![](/files/CkHFx53rinSzI3ck94gA)

### Copying preferences for CSS selectors

**Copy original selectors**: CSS Pro will try its best to copy the selectors in their original form (removing invalid parts of it when necessary).

**Smartly generate selectors**: CSS Pro will generate a unique selector for every CSS. This generates a bigger output, but it's specific and won't cause conflict with your current CSS.

<figure><img src="/files/FFsKogwIn4UONBAaV9R5" alt=""><figcaption></figcaption></figure>

### Other copying preferences:

* **Convert font-size measurement units to px**
  * If the CSS property `font-size` is declared on the element, will always be rendered in pixels.
* **Ignore box-sizing**
  * Ignores the CSS property `box-sizing` (don't show it when inspecting elements, even if it's declared)
* **Ignore browser vendor prefixes**
  * Ignores browser vendor prefixes such as (`-webkit-`, `-moz-`, `-ms-`, etc) (don't show it when inspecting elements, even if it's declared)
* **Ignore inherited properties**
  * Ignores inherited CSS properties (such as `font-family`, `font-size`, `color`, etc)
* **Convert relative URLs to absolute**
  * Converts all relative URLs to absolute in the CSS.
  * Example: "`background: url(../assets/img.jpg)`" turns into "`background: url(https://yourwebsite.com/assets/img.jpg)`"
* **Nest pseudo-classes, pseudo-elements, and media queries (for SASS/LESS)**
  * If you use CSS pre-processors like *SASS* and *LESS*, this can copy the code with the pseudo-classes, pseudo-elements, and media queries as "nested".
* **Don't copy CSS selectors when possible**
  * If the copied code is simple (without child elements and without HTML code), it won't copy the CSS selectors.
* **Copy fonts**
  * Copies the website's custom fonts imports (`@font-face` declarations with their URLs)

![](/files/OcaW261B9Ici0fbGCbvi)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.csspro.com/copying/copying-css-and-html.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
