Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Alexey Tseitlin
5,866 PointsBorder
How to make the border of the text to be the size of the text itself? Right not the border is screen-wide but the text only takes 1/10 of the screen.....
<div class="midtext">
Fresh view
</div>
.midtext {
/*MIDDLE POSITION*/
position: absolute;
width: 100%;
text-align: center;
top: 30%;
/*BORDER*/
border-bottom: 1px white solid;
1 Answer
Jesus Mendoza
23,289 PointsInstead of adding the text to the container, add it to the text. For example:
.midtext p {
border:1px solid black;
}
That will add the border to the paragraph instead of the container