/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-css-62b2af18fbab-css-s0695-c0000.md
`css` - hono-docs
css Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt css Summary You can write CSS in the css temp...
css
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#css
Summary
You can write CSS in the css template literal. In this case, it uses headerClass as a value of the class attribute. Don't forget to add as it contains the CSS content. ``ts{10,13} app.get('/', (c) => { const headerClass = css...
Content
You can write CSS in the css template literal. In this case, it uses headerClass as a value of the class attribute. Don't forget to add <Style /> as it contains the CSS content.
app.get('/', (c) => {
const headerClass = css`
background-color: orange;
color: white;
padding: 1rem;
`
return c.html(
<html>
<head>
<Style />
</head>
<body>
<h1 class={headerClass}>Hello!</h1>
</body>
</html>
)
})You can style pseudo-classes like :hover by using the nesting selector, &:
const buttonClass = css`
background-color: #fff;
&:hover {
background-color: red;
}
`