> For the complete documentation index, see [llms.txt](https://docs.webstudio.is/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.webstudio.is/university/foundations/copy-paste/html-with-css.md).

# HTML with CSS

When you paste HTML that includes `<style>` blocks, Webstudio extracts the CSS rules and converts class-based selectors into [design tokens](/university/foundations/design-tokens.md). Use this when you want pasted markup to become editable Webstudio components instead of remaining embedded code.

## How to paste HTML with CSS

1. Copy HTML that includes a `<style>` block.
2. Paste it onto the canvas in Webstudio.
3. Webstudio creates the component structure and applies matching class styles as reusable style tokens.

If a nested selector references elements not present in the pasted HTML, Webstudio shows a notification listing the skipped selectors.

If the pasted HTML/CSS references image URLs, such as `<img src="...">` or `background-image: url(...)`, Webstudio uploads those images into [Assets](/university/foundations/assets.md) and rewrites the pasted components/styles to use the uploaded assets.

## Related

* [CSS](/university/foundations/copy-paste/css.md) – Paste CSS declarations into the Style Panel
* [HTML with Tailwind](/university/foundations/copy-paste/html-with-tailwind.md) – Paste HTML containing Tailwind utility classes
* [Referenced images](/university/foundations/copy-paste/images.md) – Understand image handling during paste
* [Design tokens](/university/foundations/design-tokens.md) – Learn how reusable style packages work
* [HTML Embed](/university/core-components/html-embed.md) – Embed custom HTML when you do not need native Webstudio components


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.webstudio.is/university/foundations/copy-paste/html-with-css.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.
