2016-06-09 46 views
1

因此,我正在从其他人开始使用模板的网站上工作,因此并非所有内容都是我的。我不是贸易的网页设计师,但我确实有编码经验。所有内容在Firefox和Chrome中完美显示,并且在Edge中完美无瑕,但在IE11中却完全错误。在IE 11和Edge上格式化错误

例子:https://imgur.com/a/r4cI0

火狐:

边缘:

的Internet Explorer 11:

我似乎无法弄清楚为什么背景颜色不显示某些方面时,用Internet Explorer查看。我似乎也无法弄清楚为什么文本不能正确地浮动,因此它位于图片旁边。

<aside> 
<h3> Fliteway Technologies</h3> 
<p>Your Single Source for Soil and Groundwater Remediation Equipment</p> 
<h3><a href="Fliteway Tour.pdf">Take a Tour!</a></h3> 
</aside> 

和这里是CSS::

在IE中观察时11.

下面是涉及该被认为是下一个到图片中的文字的HTML页眉和页脚也显示不正确

aside { 
float: right; 
width: 225px; 
height: auto; 
background-color: #E3E3E3 !important; 
background-color: rgba(227, 227, 227, 1); 
background:#E3E3E3; 
margin-top: 0; 
clear: left; 
padding-top: 10px; 
padding-bottom: 10px; 
position: relative; 
overflow: hidden; 
margin-left: auto; 
margin-right: 0; 
margin-bottom: auto; 
display: block; 
visibility: inherit; 

在CSS中有一些混乱,因为我一直在尝试任何我在网上遇到的问题,试图解决这个问题。任何建议将不胜感激,因为我真的坚持这一点。

编辑:

图片HTML:

<sidepicture> 
<div class="sidepicture"><img src="_images/Bld with Addition.jpg" alt="Shop" width="564" height="270"></div> 
</sidepicture> 

图片CSS:

.sidepicture { 
display:inherit; 

}

+0

我们需要图片的html/css以及它的父元素,尽管您应该避免使用float来布局,以及您需要支持哪些浏览器? ...从IE11开始? – LGSon

+0

好吧,我已经添加了图片的HTML和CSS。我不太清楚你的父母元素是什么意思,但我对此仍然很陌生。你会如何推荐我格式化呢? – Echo1

+0

@LGSon所要求的是''aside'元素的CSS。如果没有这个,我可以给你的唯一提示是使用ms风格的变量,也就是当你在'display:block'下写'display:-ms-block'时。 – a1626

回答

1

对于新的浏览器,我建议使用flex

.wrapper { 
 
    display: flex; 
 
} 
 
aside { 
 
    width: 225px; 
 
    background:#E3E3E3; 
 
} 
 

 
sidepicture { 
 
}
<div class="wrapper"> 
 
    <sidepicture> 
 
    <div class="sidepicture"> 
 
     <img src="_images/Bld with Addition.jpg" alt="Shop" width="564" height="270"></div> 
 
    </sidepicture> 
 
    <aside> 
 
    <h3> Fliteway Technologies</h3> 
 
    <p>Your Single Source for Soil and Groundwater Remediation Equipment</p> 
 
    <h3><a href="Fliteway Tour.pdf">Take a Tour!</a></h3> 
 
    </aside> 
 
</div>

旧版本浏览器,我会用display: table

附注:如果目标旧的浏览器要知道他们可能不支持自定义标签,如您<sidepicture>

.wrapper { 
 
    display: table; 
 
    width: 100%; 
 
} 
 
aside { 
 
    display: table-cell; 
 
    width: 225px; 
 
    background:#E3E3E3; 
 
    vertical-align: top; 
 
} 
 

 
sidepicture { 
 
    display: table-cell; 
 
    vertical-align: top; 
 
}
<div class="wrapper"> 
 
    <sidepicture> 
 
    <div class="sidepicture"> 
 
     <img src="_images/Bld with Addition.jpg" alt="Shop" width="564" height="270"></div> 
 
    </sidepicture> 
 
    <aside> 
 
    <h3> Fliteway Technologies</h3> 
 
    <p>Your Single Source for Soil and Groundwater Remediation Equipment</p> 
 
    <h3><a href="Fliteway Tour.pdf">Take a Tour!</a></h3> 
 
    </aside> 
 
</div>

+0

这固定了Edge中的显示问题,我对此非常赞赏,但是在IE 11中查看时没有可见的变化。 – Echo1

+0

@ Echo1我测试了'flex'版本在Chrome,Firefox,Edge,IE11中使用上述代码片段,并且它们都呈现相同的结果。如果你自己的代码没有,我需要看看它。 – LGSon

+0

这里是HTML和CSS文件。如果你需要别的什么,我会帮助你。 https://www.dropbox.com/sh/yel9due2qis1v3k/AABNO-XTAgLjueL6nkbPQyGRa?dl=0 – Echo1