+ 22

How to use punctuation signs with HTML formatting tags? Should I include dots and comas into tags like <b> and <i>?

For example <p>This text is <b>bold</b>, <i>italic</i> and <u>underlined</u>.</p> Or <p>This text is <b>bold,</b> <i>italic</i> and <u>underlined.</u></p>

28th May 2020, 2:33 PM
Dual Core
Dual Core - avatar
5 Antworten
+ 19
Thank you good people for clearing my doubts. I want use mark up properly and I don't really care about beatification for now. I chose to ask about formatting tags because they have a visible effect on special characters. Sorry! I will learn and use CSS to decouple my design from my markup. I promise!
29th May 2020, 8:54 AM
Dual Core
Dual Core - avatar
+ 7
Adding to Sandra Meyer, I would avoid using <b>, <i>, and <u> as these are legacy tags that break convention from using HTML5 semantic tags. Rather, you should consider using <strong> and <em> for bold and italics. Apply CSS to anything you want underlined. This will help you keep your design decoupled from your markup.
28th May 2020, 6:55 PM
David Carroll
David Carroll - avatar
+ 4
Beautification? I would leave them outside the formatting tags since a dot or a comma does not explain if it was italic or bold or underlined. I prefer leaving out special characters from formatting as far as possible in general. <p><u>This</u>: is my favourite case to spare it out.</p>
28th May 2020, 3:57 PM
Sandra Meyer
Sandra Meyer - avatar
+ 2
yes, we can add the dot and commas into tags like <b>,<i>,<u>,<del>,<sub>,<sub>,etc... For example <p>this is paragraph<p> here we want add a <b> or we want to text is bold then using <b> tag. Using <b> tag:- <p>this is <b>bold</b>text</p> We can use many more tags in one paragraph using commas shown in below: <p>this is <b>bold</b> text, this text is <i>italic</i>,this text is <del>deleted</del>, this text is <ins>inserted</ins>. this is <u>underlined</u> text.</p>
12th Jun 2020, 3:20 AM
Kiran Khandade
Kiran Khandade - avatar
- 1
I would suggest you to use html Only for defining the format and using css for styling and decoration bcoz it is much easier and effective to use css. If you don't know css much better then you can take up the css tutorial from here.
12th Jun 2020, 3:25 AM
Rj-tek
Rj-tek - avatar