content
Tailwind CSS Link
The link component facilitates setting hyperlinks from inline text items, buttons, or cards to navigate between pages or external websites.
The link
component class serves as the standard class for the basic anchor tag.
<a href="#" class="link">Default link</a>
Apply the link-hover
modifier class to make links underlined when hovered over.
<a href="#" class="link link-hover">Underline when hovered over.</a>
Apply the link-animated
modifier class to make links underlined with animation on hovered over.
<a href="#" class="link link-animated"> Animated underline when hovered over.</a>
Utilize the link-{semantic-color}
modifier class to assign specific semantic colors to links.
<a href="#" class="link link-neutral">Neutral link</a>
<a href="#" class="link link-primary">Primary link</a>
<a href="#" class="link link-secondary">Secondary link</a>
<a href="#" class="link link-accent">Accent link</a>
<a href="#" class="link link-info">Info link</a>
<a href="#" class="link link-success">Success link</a>
<a href="#" class="link link-warning">Warning link</a>
<a href="#" class="link link-error">Error link</a>
Use the --link-color
for the custom color of the link.
<a href="#" class="link [--link-color:purple]">Default</a>
<a href="#" class="link link-hover [--link-color:purple]">Underline on Hover</a>
<a href="#" class="link link-animated [--link-color:purple]">Animated Underline</a>
Below is an example demonstrating how to use links within paragraph.
Tailwind CSS resets the appearance of links by default.
To restore them to a standard look, add the 'link' class, making it appear as a normal link once more.
<p>Tailwind CSS resets the appearance of links by default.<br/>
To restore them to a standard look, add the 'link' class, making it appear as a <a href="#" class="link">normal link</a> once more.</p>
Below is an example demonstrating how to use links in card.
Card title
Some quick example text to build on the card title and make up the bulk of the card's content.
<div class="card max-w-sm">
<div class="card-body">
<h5 class="card-title mb-0">Card title</h5>
<div class="text-base-content/50 mb-3">Card subtitle</div>
<p class="mb-4">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<div class="card-actions">
<a href="#" class="link link-primary link-hover">Card link</a>
<a href="#" class="link link-primary link-animated">Another link</a>
</div>
</div>
</div>
Below is an example demonstrating how to use links in alert.
<div class="alert alert-soft" role="alert">
Please read the support <a href="#" class="link">policy</a>.
</div>