> 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/intro-to-informatics-and-web-development/1-3-basic-css.md).

# 1-3 Basic CSS

So far, we've only focused on content for a webpage using HTML. What else might you want to change about this webpage about Smart Phone Safety to make it more engaging or attractive?

![](https://3718926237-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LDgX-RgU994GjN7nvcR%2F-LDgX6N0pHKbYL1KWUWR%2F-LDgX6mZTEGYzEmDlbI-%2FWebsite%20Without%20CSS.png?generation=1527608035569831\&alt=media) ![](https://3718926237-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LDgX-RgU994GjN7nvcR%2F-LDgX6N0pHKbYL1KWUWR%2F-LDgX6maWdAeS0z7apav%2FCSS%20Preview.png?generation=1527608016899946\&alt=media)

## CSS Syntax - used for design of a website

![](https://3718926237-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LDgX-RgU994GjN7nvcR%2F-LDgX6N0pHKbYL1KWUWR%2F-LDgX6mcXEqCdGPR10Rq%2FCSS%20Syntax%20Diagram.png?generation=1527608036058360\&alt=media)

## Common CSS Properties

-color (text color)

-font-family

-background-color (color behind text)

-text-align (center, left, right)

-font-size (measured in pixels abbreviated as px)

-margin (in pixels)

-height (in pixels)

-width (in pixels)

[CSS on W3 Schools](https://www.w3schools.com/css/css_syntax.asp)

## CSS Colors (These 3 options would allow be the color Red)

1\) Use an exact color name:

```
color: red;
```

2\) Using an RGB value:

```
color: rgb(255, 0, 0);
```

3\) Using a hex value:

```
color: #ff0000;
```

**This allows you to customize the colors you use to make your website more dynamic!**

[Color List](https://www.w3schools.com/colors/colors_names.asp)

[HTML Color Codes](http://htmlcolorcodes.com)

## Adding Comments to Your Code

HTML:

```
<!-- Write your comments here -->
```

CSS:

```
/* Write your comments here */
```

#### Why would adding comments to your code be important?

**Note: Shortcut to comment out your code: Select the text, Hold Ctrl Key, click the ? Key**

## Assignment

### Standard Deliverable

Open up your “History of Computers” codepen. Click the Fork button to start a new codepen file. Rename it to “Updated History of Computers”.

**Required Elements**

1\)Add design for each part of your website.

2\)You can change the font-family, font-size, color, background-color, or anything else that you want to change.

3\)Add comments to your CSS for each thing you change. You can do it like this:

-![](https://3718926237-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LDgX-RgU994GjN7nvcR%2F-LDgX6N0pHKbYL1KWUWR%2F-LDgX6mqYKRuwulyQnOL%2FCSS%20with%20Comments.png?generation=1527608028503284\&alt=media)

### Advanced Deliverable

Complete the following by searching the reference material on <http://W3schools.com> or another site.

1\)Add a border of your choice to one of the elements on your page.

2\)Change the margin for one of the elements on your page.

3\)Add comments to your code for these changes.

## Code Review Exercises:

1\) CSS Basics - [Colorful Creature](https://www.khanacademy.org/computing/computer-programming/html-css/intro-to-css/p/challenge-colorful-creature)

2\) Font Families - [Fancy Font Families](https://www.khanacademy.org/computing/computer-programming/html-css/css-text-properties/p/challenge-fancy-font-families)

3\) Font Sizes - [Great Big Font Sizes](https://www.khanacademy.org/computing/computer-programming/html-css/css-text-properties/p/challenge-great-big-font-sizes)


---

# 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/intro-to-informatics-and-web-development/1-3-basic-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.
