I'm wanting to know if what I'm doing is the "right way" even though in programming(thought HTML isn't really a programming language) there are several ways to solve a problem.

I'm currently applying my current knowledge of HTML by making a website that users can read novels/books in it. I wanna know if I should use multiple p elements for every paragraph or a single paragraph with multiple br elements.

I'm currently using multiple p elements. So I'm having doubts if this is a correct way. Sometimes there are paragraphs in the book that only takes up on line, usually when a conversation is happening with the characters, so there's a lot of p elements in my html file.

<p>Look, I didn't want to be a half-blood. </p><p>If you're reading this because you think you might be one, my advice is: close this book right now. Believe whatever lie your mom or dad told you about your birth, and try to lead a normal life.</p><p>Being a half-blood is dangerous. It's scary. Most of the time, it gets you killed in paiful, nasty ways.</p><p>If you're a normal kid, reading this because you think it's fiction, great. Read on. I envy you for being able to believe that none of this ever happened.</p><p>But if you recognize yourself in thses pages&mdash;if you feel something stirring inside&mdash;stop reading immediately. You might be one of us. And once you know that, it's only a matter of time before <em>they</em> sense it too, and they'll come for you.</p><p>Don't say I didn't warn you.</p><hr><p>My name is Percy Jackson.</p><p>I'm twelve years old. Until a few months ago, I was a boarding student at Yancy Academy, a private school for troubled kids in upstate New York.</p><p>Am I a troubled kid?</p><p>Yeah. You could say that.</p><p>I could start at any point in my short miserable life to prove it, but things really started going bad last May, when our sixth-grade class took a field trip to Manhattan&mdash;twenty-eight mental-case kids and two teachers on a yellow school bus, heading to the Metropolitan Museum of Art to look at ancient Greek and Roman stuff.</p><p>I know&mdash;it sounds like torture. Most Yancy field trips were.</p><p>But Mr. Brunner, our Latin teacher, was leading this trip, so I had hopes</p>

So the result looks the same as how it looks like in the book. But the only thing I'm wondering is if it would be better to just use a single p element and then use different br elements.

2

Best Answer


The <p> tag is for paragraphs, so if they really are paragraphs (not always easy to say), they should all be wrapped with their own <p> tag. I like to think about the <br> more like a shift+enter, if you know what I mean... If you want my advice, stick with your current method, and use <br> only if it is really obvious.

It all depends upon the look and feel that you would like to give to your users. Although I would suggest to carry-on with the same approach. It will be easier for you to manage you code and editing content.