My CopyFit isn’t working in my template. I have a box setup as a paragraph. The paragraph is variable, if it’s too big to fit, I’d like the font to shrink. I clicked the box and chose checkmarked the box CopyFit. I made my min and max fonts but the text doesn’t shrink the box. Attached is the screenshot of my setup. Is there something that I’m doing wrong?
Hi Sander,
This is the the HTML: (I removed all of the “<” to get the code to show.
div
data-copyfit=“{"minSize":"10pt","maxSize":"15pt","widthOnly":false,"childSelector":""}”
anchor=“page_media_0”
style=“position: absolute; overflow: hidden; box-sizing: border-box; width: 492px; height: 124px; top: 132.634px; left: 1118.98px; text-align: center; background-size: auto auto; display: block;” offset-x=“1118.9761” offset-y=“132.634”>
p style=“line-height: 40px; margin-top: 10px; margin-bottom: 10px;”>
span style=“font-family: "Gill Sans Nova Light"; font-size: 42pt;”>Meet @chn_fname@
Copy Fit works by changing the font size of one particular element. If you leave the Child input field empty the target element is the box itself (i.e. the div). Any absolute font size set on a child element (in your case the span with a font size of 42pt) will be changed to a relative font size so that it keeps the same font size relative to the font size of the div.
You can do one of two things:
Move the 42pt font-size style from the span to the div
Set the Child input field to “span” (without the quotes)
It looks like you accidentally set the font size on the p instead of the div.
I tried both methods with your HTML and they work for me. Are you perhaps looking at this in design mode? You need to switch to preview mode to see the effects of Copy Fit.
Edit: Scratch that, sorry. Of course you switched to preview mode, the name is variable.
Edit 2: Just to clarify, I only tried it with your original HTML. I see that you modified it slightly, the p now has a larger line height and no margins. It shouldn’t matter, but maybe that changes something.
Note: In your new HTML you applied a line height of 60px to the p, which is larger than the maximum font size. I don’t think that will work well. In fact I think it would be better to remove the line height style.
I think there may have been too many DIV box settings in mine. I took your div box setting and replaced my entire div box with it. I repositioned the box and it seems to be working properly now.