> For the complete documentation index, see [llms.txt](https://docs.idew.org/code-internet-of-things/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.idew.org/code-internet-of-things/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).

![](/files/-LJuNDCYtwK4gddqF152)


---

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.idew.org/code-internet-of-things/tutorials/create-smart-light/3.8-web-app-css.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
