为了账号安全,请及时绑定邮箱和手机立即绑定

IE7不理解显示:内联块

IE7不理解显示:内联块

婷婷同学_ 2019-07-05 12:59:08
IE7不理解显示:内联块有人能帮我把头挪开吗?火狐运行良好,但与InternetExplorer 7不同。似乎不明白display: inline-block;.HTML:<div class="frame-header">     <h2>...</h2></div>CSS:.frame-header {     height:25px;     display:inline-block;   }
查看完整描述

3 回答

?
慕姐8265434

TA贡献1813条经验 获得超2个赞

更新

由于不再使用IE6和IE7,我将提出一个不同的解决方案:
你不需要黑客了,因为IE8支持它自己

对于那些必须在IE8之前支持石器时代浏览器的人来说(并不是IE8也那么旧)咳嗽):
对于IE版本控制,请在<html>标签式保罗·爱尔兰各国他的文章

<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8"><![endif]--><!--[if IE 8]><html class="no-js lt-ie9">
<![endif]--><!--[if gt IE 8]><!--><html class="no-js"><!--<![endif]-->

这样,对于不同的IE浏览器,html-tag中将有不同的类。

您需要的CSS如下所示

.inline-block {
    display: inline-block;}.lt-ie8 .inline-block {
    display: inline;
    zoom: 1;}

这将验证,您不需要额外的CSS文件


旧答案

.frame-header{
    background:url(images/tab-green.png) repeat-x left top;
    height:25px;
    display:-moz-inline-box;    /* FF2 */
    display:inline-block;   /* will also trigger hasLayout for IE6+7*/}/* Hack for IE6 */* html .frame-header {
    display: inline; /* Elements with hasLayout and display:inline behave like inline-block */}/* Hack for IE7 */* + html .frame-header {
    display: inline; /* Elements with hasLayout and display:inline behave like inline-block */}


查看完整回答
反对 回复 2019-07-05
  • 3 回答
  • 0 关注
  • 421 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信