> For the complete documentation index, see [llms.txt](https://ayugioh2003.gitbook.io/free-code-camp-practice/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayugioh2003.gitbook.io/free-code-camp-practice/front-end-development-certification/html5-and-css/html5-and-css-51.md).

# HTML5 and CSS: 51-

51 - Override Class Declarations with Inline Styles

* 用 in-line style
* `<h1 style="color: green">`
* in-line 的優先度比 id 屬性高

```markup
<style>
  body {
    background-color: black;
    font-family: Monospace;
    color: green;
  }
  #orange-text {
    color: orange;
  }
  .pink-text {
    color: pink;
  }
  .blue-text {
    color: blue;
  }
</style>
<h1 id="orange-text" class="pink-text blue-text" style="color: white">Hello World!</h1>
```

52 - Override All Other Styles by using Important

* 你以為 inline 是覆蓋優先層級最高的嘛
* 錯了，還有 !important
* `color: red !important;`

```markup
<style>
  body {
    background-color: black;
    font-family: Monospace;
    color: green;
  }
  #orange-text {
    color: orange;
  }
  .pink-text {
    color: pink !important;
  }
  .blue-text {
    color: blue;
  }
</style>
<h1 id="orange-text" class="pink-text blue-text" style="color: white">Hello World!</h1>
```

53 - Use Hex Code for Specific Colors

* hexadecimal code, hex code, 十六進位制
* 6個hexadecimal digits 代表 color
* [Hexadecimal - Wikipedia](https://en.wikipedia.org/wiki/Hexadecimal)
* [RGB color model - Wikipedia](https://en.wikipedia.org/wiki/RGB_color_model)

```markup
<style>
  body {
    background-color: #000000;
  }
</style>
```

54 - Use Hex Code to Mix Colors

* **FF8080，#80FF80，#8080FF 意外的好看**

| Color       | Hex Code |
| ----------- | -------- |
| Dodger Blue | #2998E4  |
| Green       | #00FF00  |
| Orange      | #FFA500  |
| Red         | #FF0000  |
| White       | #FFFFFF  |
| Black       | #000000  |
| Gray        | #808080  |

55 - Use Abbreviated Hex Code

* 可用簡碼，三碼

```markup
<style>
  .red-text {
    color: #F00;
  }
  .fuchsia-text {
    color: #F0F;
  }
  .cyan-text {
    color: #0FF;
  }
  .green-text {
    color: #0F0;
  }
</style>

<h1 class="red-text">I am red!</h1>

<h1 class="fuchsia-text">I am fuchsia!</h1>

<h1 class="cyan-text">I am cyan!</h1>

<h1 class="green-text">I am green!</h1>
```

56 - Use RGB values to Color Elements

* RGB value

```markup
<style>
  body {
    background-color: rgb(0, 0, 0);
  }
</style>
```

57 - Use RGB to Mix Colors

* Blue    rgb(0, 0, 255)
* Red    rgb(255, 0, 0)
* Orchid    rgb(218, 112, 214)
* Sienna    rgb(160, 82, 45)


---

# 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://ayugioh2003.gitbook.io/free-code-camp-practice/front-end-development-certification/html5-and-css/html5-and-css-51.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.
