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
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.
这是因为标签元素本身的性能满足不了web设计的需要。所以就需要运用display。
举个简单的例子:
在img标签外包裹a标签,则会出现以下的问题:图片下方有红色小横条(图片请读者自行添加)。
要解决这个问题只要为img标签添加上display:block:;即在第15行添加img{display:block:}