Home  >  Q&A  >  body text

内联、块状元素为什么要互换?什么情况下要互换?

看透不说透看透不说透2853 days ago1546

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-09-30 23:46:26

    Why should inline and block elements be interchanged? Under what circumstances should it be swapped? -PHP Chinese website Q&A-Why should inline and block elements be interchanged? Under what circumstances should it be swapped? -PHP Chinese website Q&A

    Please watch and learn.

    reply
    0
  • 迷茫

    迷茫2016-12-26 15:34:41

    这是因为标签元素本身的性能满足不了web设计的需要。所以就需要运用display。

    举个简单的例子:

    在img标签外包裹a标签,则会出现以下的问题:图片下方有红色小横条(图片请读者自行添加)。

    要解决这个问题只要为img标签添加上display:block:;即在第15行添加img{display:block:}


    reply
    2
  • Cancelreply