Help: Cannot create a white stroke around text using text shadow with the new UI

Hey everyone,

This is my first post on here so I hope someone can help me out (and that this makes some sense). I’ve looked this issue up and found that you used to be able to apply a white stroke around text (with transparent fill) using the ‘letterpress’ style in the ‘Text Shadow’ section. However, I can’t find this in the current UI. Does anyone know a way to do this? I’ll attach some screenshots of what I’m trying to create below.

Thank you :v:

Solutions that I’ve found for previous UI but don’t work for me:

Desired effect:

My aim is to have both the filled text and stroke text in the same H1 div to get a nice effect when next to one another.

Current UI:

Hey @shamz10. The shadow thing is a bad practice. It’s simply better to add the following line in your custom code Head section:

<style>
   .name-of-class: {
    -webkit-text-stroke: 1px #ffffff;
    -webkit-text-fill-color: transparent; 
    }
</style>

You can of course play around the stroke thickness and color and the fill color.
Note that this will override whatever color you give to your text, but will only show when you export.

1 Like

Hey @Mr_Finn,

Thanks for the quick response. This may sound stupid but I’m new to Webflow and still running on the basic free account. Am I still able to edit my code like you suggested?

Also, will that code allow me to have multiple styles in the same div, or will I have to make them separate?

Thanks :grinning:

Hmm, I cannot recall if the free account allows you add custom code, but try to check it out. From your project, left top corner, click on the burger menu, and go to project settings.

Then go to custom Code and paste the code in your head section. (if not allowed, it will be locked, but I think you should be able to)

Yea yea, you can apply any style you want from your Webflow designer. Having multiple CSS rules works fine, no worries. Like I said, the only property that this will override is the font’s color.

Now since you have a free plan, you won’t be able to export it, so the result will appear only when you publish it /stage it (Webflow lets you stage 2 websites with the free plan).

Yeah I’m afraid I won’t be able to add it. At least I know how to do it now for when I switch my account over to premium so, thank you!

@Mr_Finn

You mentioned about the colour changing. If I want a transparent text fill plus the stroke, that will all be fine once I export? It just will change the colour in the webflow preview? Sorry if I’m not understanding this correctly - I’m new to all this :sweat_smile:.

I get what you’re saying about having multiple text styles tho. I’ll just need to assign the individual bits of text as the ‘stroke class’ and ‘filled text class’ etc. Right?

Haha no worries mate.
Yes, any color you give to your text in your Webflow file, the color you now see in your preview, will no longer show once you add the code and export it. The color you set in your -webkit-text-fill-color (transparent white, black, any color), will overwrite the initial text color.

And yes exactly, give the texts you want to have the stroke property a different name than the regular texts. If the stroked text needs to have the same properties as a regular text in the same section (except for the stroke, obviously), it is easier to then make it a combo class. Your class name will look like this: class=“filled-text stroke-text”, and in your custom code simply add it like this:

<style>
   .filled-text .stroke-text: {
    -webkit-text-stroke: 1px #ffffff;
    -webkit-text-fill-color: transparent; 
    }
</style>

Just to be clear, you weren’t able to do that before, and the new shadow panel allows you all you could do before. Letterpress was just a preset for a 1px shift of the shadow, but in no way you could do a border with it IIRC.

@Mr_Finn is pointing to the right answer here with CSS text-stroke.

@Mr_Finn @vincent

Thank you!

I had the same problem, was finding a way how to do the stroke around texts. But sadly webflow does not allow you to add custom code on a free plan.