HOW TO FIX THE IE7 AND INLINE-BLOCK CSS BUG

本文介绍了一种在IE7中解决CSS display:inline-block布局问题的方法。通过使用zoom:1及*display:inline属性,解决了响应式设计中无序列表水平排列的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转载地址:https://uncorkedstudios.com/blog/how-to-fix-the-ie7-and-inlineblock-css-bug


While redesigning the previous Uncorked website to be responsive, we found that a few CSS bugs came along with it. One thing to remember, is that supporting Internet Explorer can be a hefty task in itself. Luckily, sometimes there are tricks to making all browsers happy.

Recently, we redesigned the Uncorked Studios website to be responsive to different browser and devices sizes. Along with the responsive design came a few CSS bugs. Here's one that involved the inline-block display in CSS.

Bug: Unordered list element using CSS display: inline-block won't align horizontally in IE7

When recently using the Blueberry responsive jquery image slider on the Uncorked homepage, the pager navigation along the bottom of the slider, which navigates between the featured images, uses display: inline-block to create a horizontal row. But of course, IE7 doesn't recognize _display: inline-block _and gave us this:

undefined

Fix: Add zoom:1 and *display: inline to the element in CSS (courtesy of The Mad Ranter)

Original CSS:

    .blueberry .pager li {
    display: inline-block;
    }

Fixed CSS:

    .blueberry .pager li {
    display: inline-block;
    zoom: 1;
    *display: inline;
    }

The asterisk (*) in front of display: inline allows for other browsers to ignore that line. Corrected appearance in IE:

undefined

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值