View Single Post
Old 03-09-2021, 02:11 AM   #1
what
Enthusiast
what began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Mar 2021
Device: none
Advantage of a <div> wrapping the page content

In many ePubs that I own, the headers (<h1> etc.) and paragraphs (<p>) of the page content are wrapped in an division element (<div>), e.g.:

Code:
<html>
...
<body>
    <div>
        <h1>Chapter Heading</h1>
        <p>The text of the chapter.</p>
    </div>
</body>
</html>
Sometimes the <body> and <div> are styled, usually defining margins, sometimes they are both unstyled.

What are the advantages and disadvantages of wrapping my page content in a <div>, and (why) should I do it?
what is offline   Reply With Quote