Remove padding for an empty element

前端 未结 8 470
灰色年华
灰色年华 2021-02-02 05:32

I\'m generating a page for an upcoming portal site, and I\'ve got an HTML element with some optional content. I\'d like the element to not render if it is empty, but adding some

8条回答
  •  无人及你
    2021-02-02 06:21

    I can't think of a CSS only way to do that.

    I would try to decide whether the element is rendered at the time I know whether there will be any content in it. That is probably the cleanest solution.

提交回复
热议问题