I need to figure out how to align the text within the border I have created. I have tried text alignment, recreating the border, & research. all I need to do is literally extend the border and center the text.
If anyone could help me figure this out it will be much appreciated. No JavaScript allowed.
<section>
<div class="container">
<div class="teams">
<p style="position: relative; left: 15px;color: white;position:relative;
top:164px;border: 2px solid #5a5c5c; width:24.9%; height:4.9ch; border-
style:outset;font-family: cursive;">CodePen for <b style="font-size: 20px">TEAMS</b></p>
</div>
<div class="education">
<p style="position: relative; left: 380px;color: white;
position:relative;top:112px; border:2px solid #5a5c5c; width: 23.2%;height: 4.9ch;
border-style:outset; font-family: cursive;">CodePen for <b style="font-size:
20px">EDUCATION</b></p>
</div>
<div class="privacy">
<p style="position: absolute; left: 702px;color:white;position: absolute;
bottom: 10%; border:2px solid #5a5c5c; width: 22.2%;height: 4.9ch; border-style:outset;
font-family: cursive;">CodePen for <b style="font-size: 20px">PRIVACY</b></p>
</div>
<div class="writing">
<p style="position: absolute; left: 1010px;color:white;position: absolute;
bottom: 10%; border:2px solid #5a5c5c; width: 25.7%; height: 4.9ch; border-style:outset;
font-family: cursive;">CodePen for <b style="font-size: 20px">WRITING</b></p>
</div>
</div>
</section>
To run your code I had to refactor it first: you missed some closing tags,
border- stylereplaced withborder-stylewithout space. After that I addedtext-align: centerand it worked :)Also, I added the missing
<b>tag around TEAMS.Moreover, there is no need to repeat CSS rules, so I removed duplicated
position: relative.P.S. To make the white text visible I added a body with a gray background.