Quote:
Originally Posted by Turtle91
There are two different purposes for the <br/> (go to the next line) and the <p> (start a new paragraph element). Technically (semantically) you aren't starting a new paragraph with each line of a TOC so a <br/> (or a <div> for that matter) would work fine. Effectively they will do mostly the same thing under most conditions, but they are semantically different.
|
A new paragraph usually looks very different from a <br> tag. The line break tag puts the following content exactly one line height of spacing lower than the text before it, as though the current paragraph wrapped to a new line. A new paragraph adds that space plus the paragraph's margin, which by default means that it looks roughly like two <br> tags in a row.
For a TOC, I would tend to use <ul><li> or <ol><li>. The content you're formatting is semantically a nested list. With the right styling, it can look like anything you want it to look like, but using proper list tags preserves the semantics of the content in the structure, which can be beneficial in some screen readers, IIRC, and also is useful for folks scraping the book and processing it in interesting ways.
So the short answer is that you probably shouldn't use either of the styles that you asked about.