# CSS tab

<figure><img src="/files/ZaZmSr5247szvc2hV6Lt" 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="/files/VQDifDQLfcIvCiGqjh8D" 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="/files/l7eRjZ2y1NQhkp3R7T8z" alt=""><figcaption></figcaption></figure>


---

# 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://dev.ubidots.com/dashboards-and-widgets/html-canvas/code-editor/css-tab.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.
