-1

I have an html element which is present on some elements, but not others. For the ones which it is not present, I need to have a size-equivalent empty space html element. This ensures that the spacing is not off.

I have tried adding the same element, but putting hidden, hidden="hidden" and style="visibility:hidden;" on the div that encapsulats the element, but that makes the build fail. Any thoughts?

Ben
  • 11
  • 2
  • 1
    "makes the build fail" Is there an error? – epascarello May 04 '23 at 17:56
  • 1
    Could you give us more detail, it seems that you could easily solve this with CSS by either using the :empty pseudo-selector or the + selector, you could even just use flexbox, and set a flex-basis, maybe even display: grid might solve it. – Davi Areias May 04 '23 at 18:51
  • 1
    Please show us enough. Code for us to see the problem. See https://stackoverflow.com/help/minimal-reproducible-example – A Haworth May 04 '23 at 19:04

1 Answers1

0

You could try using opacity: 0 instead of visibility.

fordat
  • 355
  • 4
  • 13
  • What the OP tried should work, but all we know is that they "[make] the build fail." We need to know why those aren't working before throwing more potential solutions at it, as `visibility: hidden` is the "correct" method for this. – Darryl Noakes May 04 '23 at 18:25