I am struggling with Tailwind CSS and trying to remove the default style for links while adding an underline to all of them.
I attempted:
@layer base {
a {
@apply underline;
}
However, I can't figure out where to place this code. I tried putting it inside a style tag in my layout blade HTML file, but it didn't work.
Another attempt was:
<style>
ul-link{
@apply underline;
}
</style>
...
<div class="ul-link">Test</div>
This approach also did not work as there was no underline visible.
Surprisingly, using the following structure worked:
<div class="underline">Test</div>
I am puzzled by why @apply is not working and unsure how to create a global style. What could I be missing?