/styles/global.css

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: black;
    color: white;
    font-size: 18px;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
    display: block;
}
body {
    line-height: 1;
}
ol,
ul {
    list-style: none;
}
blockquote,
q {
    quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
    content: "";
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/styles/navigation.module.css

.nav {
    background-color: red;
    padding: 50px 100px;
}

.list {
    display: flex;
}

/components/navigation.tsx

"use client";

import Link from "next/link";
import {usePathname} from "next/navigation";
import styles from "../styles/navigation.module.css";

export default function Navigation () {
    const path = usePathname();
    return (
        <nav className={styles.nav}>
            <ul className={styles.list}>
                <li>
                    <Link href="/">Home</Link>{path === "/" ? "πŸ”₯" : ""}
                </li>
                <li>
                    <Link href="/about-us">About us</Link>{path === "/about-us" ? "πŸ”₯" : ""}
                </li>
            </ul>
        </nav>
    );
}

Next.js μ• ν”Œλ¦¬μΌ€μ΄μ…˜ μŠ€νƒ€μΌλ§: CSS λͺ¨λ“ˆκ³Ό κΈ€λ‘œλ²Œ μŠ€νƒ€μΌ 적용

1. CSS λͺ¨λ“ˆμ˜ λ„μž…

2. κΈ€λ‘œλ²Œ μŠ€νƒ€μΌ μ„€μ •

3. CSS λͺ¨λ“ˆ 적용