html - Div 在 FF 或 IE 中无法正确显示

标签 html css internet-explorer firefox

我在一个网站上工作,在该网站上我将主页上的 div 设置为可点击并具有图像背景。

主页在 Chrome 中正确显示文本后面的不透明 div,但在 FireFox 和 Internet Explorer 中您看不到不透明 div,并且文本位于 div 的顶部。

<div id="main" class="site<?php if ( $with_sidebar ) : ?> site-with-sidebar<?php endif; ?>">
<div id="content" class="site-content">     
<!----Home Content START---->
        <div style="width: 980px; overflow: auto;">
                        <div  onclick="window.location='/portfolio/architecture/architecture/';" id="item1" style="width:453px; height:400px; background-image:url('http://jeremy.insctest1.com/wp-content/uploads/2015/02/arch-home.png'); float: left; margin: 0 20px 20px 0;">

                <div class="item-title" style="width:inherit; position: relative; top:350px; height: 50px; background: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(232,232,232,0.8)), color-stop(1, rgba(214,214,214,0.8)) ); display: table-cell; vertical-align: middle;" >

                <center> Architecture </center>
                </a>
                </div>
            </div>

最佳答案

这是因为您的后台容器正在使用特定于供应商的前缀样式 -webkit-gradient ,FF 和 IE 将忽略它。这个问题 (Linear-gradient works only with -moz vendor prefix) 将为您提供正确实现渐变所需的所有供应商前缀。

关于html - Div 在 FF 或 IE 中无法正确显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29079433/

相关文章:

html - 如何正确对齐 Bootstrap 中的工具栏?

html - 需要交叉而不是在 SVG 中打勾

php - 单击建议时无法选择建议

html - CSS表格单元格背景图片样式(两个三 Angular 形)

javascript - 如何强制 iframe 调整大小以适应嵌入式文档?

Javascript .pathname IE 怪癖?

javascript - 在 IE 10 中使用 id 获取值表单文本框

html - 换行符在 IE 和 Chrome 中呈现不同

jquery 鼠标悬停 while 循环

javascript - 按多个类别过滤然后从最相关的列表中排列?