> For the complete documentation index, see [llms.txt](https://docs.launchboard.app/cxd/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.launchboard.app/cxd/code-internet-of-things-2.0/tutorials/create-smart-light/3.8-web-app-css.md).

# C-8 Web App CSS

Next, you'll add the CSS for your web app's stylesheet.

## Add CSS

Copy this CSS, and paste it into a **blank** CSS file named `style.css`:

```css
body {
    font-family:  Helvetica, Arial, sans-serif;
    font-size: 1em;
    text-align: center;
}

.card {
    width: 250px;
    height: 200px;
    margin: 0 auto 20px;
    padding: 10px;
    background-color: #ccc; /* gray */
    border: 2px solid #aaa;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0,0,0,0.2);
}

.light-on {
    background-color: #ffff99; /* yellow */
}

button {
    width: 100px;
    padding: 10px;
    font-size: 1em;
    color: #444;
    background-color: white;
    border-radius: 10px;
}
```

As you can see, this CSS has style declarations for 4 types of elements in your HTML:

1. The CSS for `body` styles the `<body>` section in your HTML.
2. The CSS for `.card` styles elements in your HTML that have `class="card"`. The `<div>` element has this class.
3. The CSS for `.light-on` styles any elements in your HTML that have `class="light-on"`. Currently, **no** elements have this class. However, your web app JS will add this class to the `<div>` element if your light is turned on (changing the card's background color to yellow) and will remove this class if your light is turned off (changing the card's background color back to gray).
4. The CSS for `button` styles the `<button>` element in your HTML.

{% hint style="info" %}
**CSS:**  If you want to learn more about CSS or need a quick reference, check out the [W3Schools CSS Tutorial and Reference](https://www.w3schools.com/css/default.asp).
{% endhint %}

## Preview Web App

If you preview the web app at this point, you can see how the CSS has changed the appearance of the web app, but it still doesn't function yet (because there's still no JS in the `code.js` file).

![](https://1128190565-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEGLBX3AeXb13IcoB4Q%2F-LJuMst_U62Xudvq-HDK%2F-LJuNDCYtwK4gddqF152%2Fsmart-light-web-app-css.png?alt=media\&token=0bbab87e-0abf-4ce9-8080-a972cdeeb44e)


---

# 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://docs.launchboard.app/cxd/code-internet-of-things-2.0/tutorials/create-smart-light/3.8-web-app-css.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.
