I've been on a quest to find the solution to this dilemma, but no matter how hard I search, I can't seem to crack it!
Here's the issue: I want to keep this small paragraph centered neatly:
a glimpse of a webpage, showcasing navigation and some text.
This is my current approach:
.intro {
text-align: center;
max-width: 25%;
}
<div class="container-fluid intro">
<hr style="height: 5px; width:40%;">
<h2>Hi, I'm Heather!</h2>
<h4>I'm a graphic design student out of New Hampshire with a love for all things fun, colorful, and creative!</h4>
<p style="text-align: center;"><a href="resume.pdf">Resume</a> <a href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="aac2cfcbdec2cfd8eac2c6c9d9dedfcec3c5d984c9c5c7">[email protected]</a>">Email</a></p>
<hr style="height: 5px; width:40%">
</div>
The trouble arises when the browser window shrinks, as the paragraph still occupies 25% of the screen real estate, leading to this problem:
a downsized version of the previous image.
I've witnessed responsive designs that maintain centered text without consuming the entire div, but somehow I can't replicate it myself.
I appreciate any assistance in deciphering this puzzle. I hope that explanation makes sense! :)