What to do if background colour have to appear only till where Text ends not complete line ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What to do if background colour have to appear only till where Text ends not complete line ?

30th Aug 2017, 10:11 AM
Prithviraj
Prithviraj - avatar
4 Answers
+ 2
Paragraphs run the length of the whole line, you could wrap a <span> around the text and apply the background there <p> <span style="background-color: grey"> this one </span> </p>
30th Aug 2017, 10:54 AM
S C
+ 1
That depends on which element has the background-color style applied to it. Post an example and someone will help you.
30th Aug 2017, 10:44 AM
LOSST
LOSST - avatar
0
<p style={bgcolor:grey} >this one </p>
30th Aug 2017, 10:46 AM
Prithviraj
Prithviraj - avatar
0
what actually is function of <span> tag
30th Aug 2017, 10:55 AM
Prithviraj
Prithviraj - avatar