// testbed and examples of PPGEN commands // Using .dv and CSS to create boxes around blocks of text. .dt Box model example, Barry Abrahamsen .de body {width:80%; margin:auto;} // It's probably entirely optional, but if some front matter has a box around it, I try to // replicated the box. This is done by formatting the text so it looks like the printed page // and then enclose that text with a .dv, giving it a class name that defines the attributes // of the box. This makes use of the CSS Box Model, which you can read about here: // https://www.w3schools.com/Css/css_boxmodel.asp // You can control the size and color of each of the attributes of a CSS box (margin, border, and // padding.) Please read the Box Model described at the URL above and // then explore what values each of the attributes can have. // Oh, and either PPGEN or our browser seems to merge any .sp commands appearing // right before the .dv that begins a box, with the box. I don't like that so I put a non-break // space between the .sp and the .dv commands. Comment out the two \_ lines below to see what // I mean. .de .box1 {border-style:double; padding:10px; margin-left: 20%; margin-right:20%} .de .box2 {border-style:solid; margin-left: 20%; margin-right:20%} .de .box3 {border-style: hidden hidden solid hidden; border-color: blue; margin-left: 20%; margin-right:20%} .h1 Creating a box around .h2 .pb .dv class=box1 .h2 Works of Robert Neilson Stephens .dv- \_ .sp 2 .dv class=box2 .h2 Works of Robert Neilson Stephens .dv- \_ .sp 2 .dv class=box3 .h2 Works of Robert Neilson Stephens .dv- // nested boxes, looks good. // outer box .de .obox {border: solid 2px; margin-left: 5%; margin-right:5%; \ padding-bottom: .5em; padding-top: .5em; padding-left: .5em; padding-right: .5em;} // inner boxes .de .ibox {border: solid 1px; margin-left: 1%; margin-right: 1%; \ padding-bottom: .5em; padding-top: .5em; padding-left: .5em; padding-right: .5em;} .nf c Example of nested boxes .nf- .dv class='obox' .dv class='ibox' This is text in the first inner box .dv- .dv class='ibox' This is text in the second inner box .dv- .dv-