If I want to place text inside a visual box (like the photo below - I’m asking as a general question for the future) is the text independent of the box? What’s the best way to do something like this?
The reason I ask is because I feel like I’m just guessing the (top right bottom left) of the text distances, especially if the box is off center.
So is this where relative/absolute come in?
I’m trying to wrap my head around it but ideally I’d want to have a block of text that can be centered inside of a visual box that may be off-center i.e imagine if the box in the photo was in the bottom right, would I use (bottom 20px, right 20px) for text or by having the text connected to the box I could use (merge: auto) to center the text in the box and not the body.
You can call it anything you like. If you’d like to call it “box”:
<div class="box"> ... </div>
Styling that particular div with class=“box” in CSS:
/* alternatively: */
That example image you posted doesn’t make sense to me. The colours don’t match what read I in the CSS, and the div in the HTML has no class=“box” (which it needs to have, if you want to style it using the div.box selector).