Design comparison
Solution retrospective
Can someone tell me how to break paragraph lines where you want to using css. I managed to do it but in HTML. I'm not sure the way I did it was correct or not.
Community feedback
- @adonmez04Posted over 1 year ago
Hi, @ThilinaDeshan98. That's a really good question. The short answer is yes. You can use
<br>
tag in html to break a paragraph. The long answer is that you should use the nestedwidth
andmax-width
value with.parent
and.child
. You should change the breakpoint of the paragraph using the width value of the child, such as.section-hero__content-area
in this example: the-responsive-design- I highly recommend this course if you want to learn more details about responsive design. Conquering Responsive Layouts
Keep coding and have a nice day.
Marked as helpful1@adonmez04Posted over 1 year ago@adonmez04 In addition to this technique, we can use this style; you can add a span tag before the element (or word) and use a pseudocode selector to add a break like this code block:
.space::before { content: "\A"; white-space: pre; }
I found it in this article: https://stackoverflow.com/questions/17047694/add-line-break-to-after-or-before-pseudo-element-content
Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord