2022-07-05 13:41:43 +00:00
|
|
|
---
|
|
|
|
sidebar_label: Page.addStyleTag
|
|
|
|
---
|
|
|
|
|
|
|
|
# Page.addStyleTag() method
|
|
|
|
|
|
|
|
Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a `<style type="text/css">` tag with the content.
|
|
|
|
|
|
|
|
**Signature:**
|
|
|
|
|
|
|
|
```typescript
|
|
|
|
class Page {
|
|
|
|
addStyleTag(options: {
|
|
|
|
url?: string;
|
|
|
|
path?: string;
|
|
|
|
content?: string;
|
2022-07-06 07:05:37 +00:00
|
|
|
}): Promise<ElementHandle<Node>>;
|
2022-07-05 13:41:43 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
|
| --------- | -------------------------------------------------- | ----------- |
|
|
|
|
| options | { url?: string; path?: string; content?: string; } | |
|
|
|
|
|
|
|
|
**Returns:**
|
|
|
|
|
2022-07-06 07:05:37 +00:00
|
|
|
Promise<[ElementHandle](./puppeteer.elementhandle.md)<Node>>
|
2022-07-05 13:41:43 +00:00
|
|
|
|
|
|
|
Promise which resolves to the added tag when the stylesheet's onload fires or when the CSS content was injected into frame.
|