I’m still deciding whether or not to have one single box for the entire text in one passage or several. I’ve been using the following code in my story stylesheet:
The problem I’m having is that the closing div tag disappears when combined with if statements. I just feel as if there’s a much easier way to approach this and would appreciate any advice.
If you do want several ‘boxs’ then you could replace the whole <div class="message"> Texty text </div> with the usage of a paragraph element like so…
<p>Texty text</p>
…and then change your CSS selector to something like…
.passage p {
/* assign properties here */
}
In regards to the styling of the whole of the ‘passage area’… If you use your web-browser’s Developer Tools to Inspect the HTML structure of the current page you will see the ‘main’ area looks something like…
<div id="story" role="main">
<div id="passages">
<div id="passage-start" data-passage="Start" class="passage">
/* Content of the Start passage... */
</div>
</div>
</div>
So you could target the #passages identifier with your 'semi-transparentstyling and the.passageCSS class with your 'black' based styling. (you would likely need to adjust theheight` properties of each element)
#passage {
/* properties to make the background semi-transparent and the correct 'height' */
}
.passage {
/* properties to make the background black with the correct margins/padding *.
}