@jeromy_ruecker
There are two ways to connect CSS in Nuxt.js:
- Add styles to the head section of the Nuxt.js layout file:
Create a CSS file (e.g., styles.css) in the assets directory.
Open the layouts/default.vue file and add the CSS file to the head section:
- Use the CSS inside a component:
Create a CSS file (e.g., styles.css) in the assets directory.
Open a component file (e.g., MyComponent.vue) and import the CSS file using the style tag:
The scoped attribute adds a unique identifier to the CSS selectors, scoping the styles to the component only.
Remember to use the correct path for the CSS file when using the ~
shortcut in Nuxt.js.