Instructor: What if we wanted to implement some personal styles either within this application or with future applications? Luckily, Next.js provides us with a few different solutions for accomplishing this. Next.js comes with built-in support for CSS in JS. To use CSS in JS, we just need to add a style prop to whichever element that we wish to style.
Inside these double curly brackets, we're then going to name CSS properties using CamelCase code. These properties are then given string values and are separated by a comma instead of the semicolon that's used in CSS. I'm going to set the text decoration to none, the font size to 18 pixels, and the color to white.
If we save it and we visit our application, we see that this is already showing up for us. Taking a look at the console, if we click on this a tag for the button, we'll see that the styles we've defined have been embedded inline inside of our a tag. This is great, but this isn't the only thing that Next provides us with. Let's take a look at its built-in support for Style JSX.
Here, I'm defining a CSS class named, "Postlink." I'm going to give it the same properties that we just defined with CSS in JS. Whereas CSS in JS had a different syntax, you'll notice that all these styles adhere to the regular CSS properties. There's no more string values, and there's no more commas separating values.
Now, if we go back to our page...Oh! We need to add this Postlink class to our a tag. As you can see, I'm using the React class name attribute. Now when I save that, we see that our styles do show up. If we take a look at the dev tools once again, we'll see that our styles are no longer inlined like they were when we used CSS in JS.
Instead of doing this, Next is actually going to create its own style tags for each selector and place them in the head of the document. By navigating to the head of our document, we'll be able to find this style tag that Next created. Inside here, we can see the styles that we just defined within our component using that custom CSS selector.