How to align last sentence to be centered or right aligned without starting new paragraph? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to align last sentence to be centered or right aligned without starting new paragraph?

If you push the green link "try it yourself", then look at the output, see the very last sentence/line in the paragraph before the closing P tag (it says "This is a text"). I'd like to know how to align or bolden that sentence without starting a new paragraph; for instance, I know if I put the CLOSING paragraph tag after the HORIZONTAL LINE, then start a NEW paragraph tag BEFORE that LAST SENTENCE like this: <p align="center"> This is a text. </p> then it would center that last sentence. But how do I center or otherwise modify that last sentence in that particular paragraph without starting a new paragraph tag? Because I know in order to add an attribute, or to modify any element like the tag or the sentence, you have to have a TAG, you can't just put: <align="center">This is a text. You have to have a <p> tag OR some other type of tag BEFORE that last sentence in order to put the center/bold attribute. But how to do so without adding new paragraph tag, what other tag can I use, if any?

31st Aug 2016, 12:13 AM
LesiaDiPenta
LesiaDiPenta - avatar
6 Answers
0
Good answer
31st Aug 2016, 1:44 AM
LesiaDiPenta
LesiaDiPenta - avatar
0
You can use the <span> tag like this. <span align="center"> centered text </span> try it yourself.
5th Sep 2016, 11:51 AM
Ahmad A. Nasriya
Ahmad A. Nasriya - avatar
0
Oh thank you so much!! Will try right now and let you know
9th Sep 2016, 7:47 PM
LesiaDiPenta
LesiaDiPenta - avatar
0
center tag
3rd Oct 2016, 1:31 AM
Shikhar Verma
Shikhar Verma - avatar
0
thanks Shikhar
18th Jul 2017, 10:51 PM
LesiaDiPenta
LesiaDiPenta - avatar
- 2
hello
31st Aug 2016, 1:04 AM
Talia