Are empty divs bad?

前端 未结 6 1440
太阳男子
太阳男子 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:43

    No, Its not bad to use it like this. But you can avoid this using psudeo content like,

    .showinfo:after{
    content: "";
    display: block;
    /*
     this will be the style for your div after
     but dont forget to specifiy the width and height and act like its a new div
     */
    }
    

提交回复
热议问题