Are empty divs bad?

前端 未结 6 1473
太阳男子
太阳男子 2020-12-03 23:04

I\'m making a website in Aptana and i\'m using an empty div element for the styling of a border-bottom.

I couldn\'t make it part of the element it\'s a border of be

6条回答
  •  长情又很酷
    2020-12-03 23:26

    If it is only a couple of them or a couple of tens of them, it will not make a significant difference and you can use them if they do the job nicely.

    But if you have around a hundred or more of them, then you should reconsider your approach, since it will increase the number of DOM elements. In general, the less DOM elements, the better. More information about optimization can be found in this excellent Yahoo's article on optimization.

提交回复
热议问题