DEV Community

Maya
Maya

Posted on

How to include span tags in an array?

I am doing a page using React and I need to make some parts of the text bold. Normally I would do this using span tags but the problem is that the text is coming from an array. I tried including the span tag in the array by concatenation but I am getting a weird result. Anyone knows a workaround?
The result:
Alt Text
The code:
Alt Text

Top comments (2)

Collapse
 
jordanfinners profile image
Jordan Finneran • Edited

Id recommend using the <i> html over span as its designed to make it italics and will help accessibility readers
w3schools.com/html/html_formatting....

Collapse
 
ramyatrouny profile image
Rami Atrouni

You do it just like this