The code is very simple:
<a>This is a link</a>
In Bootstrap 4 Alpha 2 demo, the link shows blue. When you hover mouse on it, it shows dark blue.
But in Bootstrap 4 Alpha 3 demo, it shows black.
Is there any special Bootstrap class can be added to let <a>
have link style in Bootstrap 4 Alpha 3?
Something like this?
<a class="bootstrap-link">This is a link</a>
Is there any clean/smart way?
Thanks
Titles, text, and links In the same way, links are added and placed next to each other by adding .card-link to an <a> tag. Subtitles are used by adding a .card-subtitle to a <h*> tag. If the .card-title and the .card-subtitle items are placed in a .card-body item, the card title and subtitle are aligned nicely.
Probably something changed between the two versions regarding the existence of the href
attribute; by adding the attribute href
to the anchor <a>
, it starts to work properly;
Code from the example with href:
<a href>This is a link</a>
Updated JSFiddle: https://jsfiddle.net/s1mvqok0/
If you see bootstrap 4 css
a:not([href]):not([tabindex]) {
color: inherit;
text-decoration: none;
}
So anchor tag gets the color of its parent element if it does not have either an href or tabindex attribute. One approach would be to provide a tabindex for the a element.
There is a class if you want to use .text-primary
that applies primary color to the anchor tag.
.text-primary{
color:#0275d8!important
}
a.text-primary:focus,a.text-primary:hover{
color:#025aa5
}
jsfiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With