How to justify text and fit to the container?
-
Hi!
I would like to know how to fit the text to the wide of the container. Also, I need to justify some text but text-align:justify doesn't works.
Thanks!
-
Dear Barry
@barrybianco
Do you have a link to the page where you would like this change to occur?
If needed you can create a new "Text Format" and then apply any custom css you need to it:https://laytheme.com/documentation/textformats-and-webfonts.html
I would also suggest looking into the 'Unit'
vw
"Viewport width"
Best ✨
Richard
-
Thanks for your response,
I would like to fit the text of this because I would keep the text in 1 line and its change a lot depend of the size of the navigator.
The justify is needed for the "related fonts" section, at the below of the page. Because I want to keep the links occupying the entire line. I could do it in separate containers but the baseline of each font shows different in this way (I don't know why).
Thanks, I will try that you commented!
-
Dear Barry
@barrybianco
Thanks for the reply, i don't quite understand sorry, but i appreciate your description:
"because I would keep the text in 1 line and its change a lot depend of the size of the navigator."
As for the second question, you have this font "Carmensin Headline Regular" and the
font-size
has been set to 150px.px
or 'pixels' are a fixed unit. They will not change based on browser size etc, so if the browser is smaller they are forced to move and occupy a different space.I would suggest looking into the use of % 'percentage' as this is a variable or responsive unit. This means that it will shrink or grow depending the size of its parent container. It's Parent container will most likely also resize with the browser so the font should resize too! 🌝
You can change the unit from 'px' to '%' in text formats. Looking into other responsive units will help as well such as 'vw' & 'vh':
Best wishes
Richard
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it