> For the complete documentation index, see [llms.txt](https://dev.ubidots.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.ubidots.com/dashboards-and-widgets/html-canvas/code-editor/css-tab.md).

# CSS tab

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FMwAoVj2iV30AvuvrV4VQ%2Fimage.png?alt=media&amp;token=5705f219-3144-48c4-97aa-ef805ce79904" alt="" width="563"><figcaption></figcaption></figure>

CSS (Cascading Style Sheets) defines styles that apply to HTML elements and customize how they appear in the browser.

### Examples

| CSS Element                                                                                                      | Effect on the corresponding HTML element                                 |
| ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| <p><code>body {</code><br><code>background-color: lightblue;</code><br><code>}</code></p>                        | Sets the HTML body background color to *lightblue*                       |
| <p><code>h1 {</code><br><code>color: white;</code><br><code>text-align: center;</code><br><code>}</code></p>     | Sets `h1` headings to use the color *white* and centers the text         |
| <p><code>p {</code><br><code>font-family: verdana;</code><br><code>font-size: 20px;</code><br><code>}</code></p> | Sets paragraphs to use the *verdana* font family and a font size of 20px |

### Advanced example

The following HTML + CSS file modifies the styles of the body, `h1`, and paragraph elements.

```html
<!DOCTYPE html>
<html>
<head>
<style>
body {
   background-color: lightblue;
}
h1 {
   color: white;
   text-align: center;
}
p {
   font-family: verdana;
   font-size: 20px;
}
</style>
</head>
<body>
<h1> This is a h1 header </h1>
<p> This is a paragraph </p>
</body>
</html>
```

It results in the following content in the browser:

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FNdvNQ083oH5P6CXUNAEL%2Fimage.png?alt=media&amp;token=a91940b5-8b5c-4d5d-8543-1c9747cea8b9" alt=""><figcaption></figcaption></figure>

To achieve this on the HTML Canvas:

* Add the following code to the HTML code editor tab:<br>

  ```html
  <h1>This is a h1 header</h1>
  <p> This is a paragraph </p>
  ```
* Add the following code to the CSS tab:<br>

  ```css
  body {
    background-color: lightblue;
  }

  h1 {
    color: white;
    text-align: center;
  }

  p {
    font-family: verdana;
    font-size: 20px;
  }
  ```

This is the resulting HTML Canvas widget on a dashboard:

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FdGsdkLrkkwCK3e4yY27v%2Fimage.png?alt=media&amp;token=fc50b30b-1f28-4aec-8dc9-f9265037df2e" alt=""><figcaption></figcaption></figure>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://dev.ubidots.com/dashboards-and-widgets/html-canvas/code-editor/css-tab.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
