Remove padding for an empty element

前端 未结 8 503
灰色年华
灰色年华 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:27

    Don't use padding on container, use margin on content. Than when there is no content, container remains invisible.

提交回复
热议问题