How can I make an element's height zero in Bubble when it contains no text?

How can I make an element’s height zero in Bubble when it contains no text? I have set a background color and padding, but the height from the padding still remains.
I have configured the following settings:

  • Checked ‘Fit height to content’
  • Set ‘min height’ to 0
  • Checked ‘Collapse when hidden’

You have two options, both with element conditionals

  1. Hiding the element completely
  2. Setting the padding to 0

The thing here is defining the conditional. What element are you dealing with?

Thank you for your response.
I’m using a text element where the text is dynamically set from Data, with a background color and padding applied.
Below is a screenshot of the element.





You have the layout setup correctly ‘Collapse when hidden.’ All you have to do now is set a condition such as when ‘dynamic value is empty’ then ‘this element isn’t visible: check’

1 Like

You can’t directly refer to This Text's content to set the condition, but you can use the exact same dynamic expression you are using for defining the content of the Text element and check whether or not it’s empty, just like @betteredbritain has proposed

1 Like

Thank you so much!
I was able to hide the text element by configuring it as shown in the image.