Design comparison
Solution retrospective
Hello, this is my first project. I'm still learning from w3schools and web.dev. I dont know how to adjust the width of the <p> and I dont know what is "rem" and how to use it.
Thank you.
Community feedback
- @sandro21-glitchPosted almost 2 years ago
the width of an HTML element such as a <p> tag can be adjusted using the width property. The value can be specified in various units, including pixels (px), percentage (%), and rem (root em).
rem stands for root em, which is a relative length unit used in web design. It is relative to the font-size of the root element (usually the <html> element) and not to the size of any parent element.
For example, if the font-size of the root element is 16 pixels, then 1 rem is equal to 16 pixels.
To specify the width of a <p> element in rem, you would write something like this in your CSS:
p{ width: 30rem; }
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