# CSS Tab

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FBOBGU8sTqtqUH2ViW36s%2FGroup%2023.png?alt=media&#x26;token=3905d096-be2f-4be8-a93f-3c39c9c46366" alt=""><figcaption></figcaption></figure>

CSS (Cascading Style Sheets) is used to define styles that can be applied to HTML elements in order to customize the way in which they are displayed in the web 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 style for the HTML body to have a *lightblue* background color                               |
| <p><code>h1 {</code><br>   <code>color: white;</code><br>   <code>text-align: center;</code><br><code>}</code></p>     | Sets the style for the h1 headers to have their color *white* as well as to center the text           |
| <p><code>p {</code><br>   <code>font-family: verdana;</code><br>   <code>font-size: 20px;</code><br><code>}</code></p> | Set the style for the paragraphs to have their font family set to *verdana* and the font-size as 20px |

### Advanced example:

The following HTML + CSS file modifies the body, H1 header, and paragraph elements' style.

```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 being displayed 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&#x26;token=a91940b5-8b5c-4d5d-8543-1c9747cea8b9" alt=""><figcaption></figcaption></figure>

To achieve this on the HTML Canvas, the following can be done:

* Place the following code on the HTML code editor tab:<br>

  ```html
  <h1>This is a h1 header</h1>
  <p> This is a paragraph </p>
  ```

* Place the following code on 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 shown on a Dashboard:

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2F2pnJpfM45BaRnFv8Fl4b%2Fimage%2040.png?alt=media&#x26;token=a1e87c9e-07cf-4585-b6f6-447f338c6fe2" alt=""><figcaption></figcaption></figure>
