<b> tag for font-weight: bold; not apply on element

<b> tag for font-weight: bold; not apply on element
0

#1

Hey!

I have use b tag inside a link like:

<a href="https://google.com"><b>Google</b></a>
Is more elegant way than just apply on a tag CSS the font weight: bold; and this is correct way to use? I mean what about <b><a href="">test</a></b> is break something?

Thanks!


#2

Both will produce same result(as per your example) but reading this will clarify the right usage of <b> tag


#3

You know for new html5 elements have include new tags and try to use them and when no need apply directly the font-weight it will be fine with b tag is something like div class test123 versus section class 123…


#4

ofc you can use font-weight but a screen reader will not know that key words are emphasized some way.


#5

In the latest readers you mean? Because need to know as is new elements in html like section or footer. The logical is that use custom elements as many you can be unique some way not like div class footer vs footer.


#6

Actually,

<strong></strong> is the more correct way if you’re worried about accessibility. you can use it in the A tag or our both should work