I have a completion message that would look a lot better if the paragraph below it was bound by the width of its title.
Currently it looks like this
Which is an issue because the paragraph flows larger than the width of the title.
.site-complete-message {
width: 95%;
margin-left: auto;
margin-right: auto;
}
.complete-title-wrap {
width: 100%;
padding-bottom: 10px;
text-align: center;
}
.complete-text-wrap {
width: 60%;
margin-left: auto;
margin-right: auto;
padding-top: 10px;
text-align: center;
}
h1 {
margin: 0;
}
p {
margin: 0;
}
<div class="site-complete-message">
<div class="complete-title-wrap">
<h1>You have levelled up</h1>
</div>
<div class="complete-text-wrap">
<p>You've completed this section. Please continue to the next page in order to level up again.</p>
</div>
</div>
This would need to work no matter the title or the text because they may differ. The title will occasionally be across two lines but this already wraps because of the DIV it is within.
Any solutions are welcome. I saw this question but it isn't taking the same initial approach as mine because I'm not using inline styles or floating. Also, this is not the same as this question about matching text to the size of an image because this is text & text so isn't comparable as it won't always have a fixed width.
Title will be set here and looks fine
the message body is going to be shown here and it must be the same width as the Title