我尝试使用 IE 11 和 Google Chrome 浏览器访问该网站。
我发现在 IE 11 浏览器中,当屏幕大于 700 像素时,徽标会出现在中心偏左一点的位置。
在 Chrome 浏览器中,当屏幕大于 700px 时,logo 出现在左侧,当屏幕小于 700px 时,logo 出现在中间。
所以看起来您希望在 IE 11 浏览器中获得类似的结果。
我尝试修改您的 CSS 代码以获得类似的结果。
下面是修改后的例子:
<!doctype html>
<html>
<head>
<title>demo</title>
<style>
html,
body {
margin: 0px;
padding: 0px;
min-width: 300px;
}
.navbar {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
-moz-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
-moz-box-align: center;
-ms-flex-align: center;
align-items: center;
z-index: 100;
padding: 20px 0px;
height: 80px;
background-color: var(--super-light-grey, white);
-webkit-filter: drop-shadow(10px 10px 50px rgba(0, 0, 0, 0.07));
filter: drop-shadow(10px 10px 50px rgba(0, 0, 0, 0.07));
}
.navbar .content {
width: 80%;
height: 100%;
font-family: var(--main-font, sans-serif);
font-size: 1.3em;
font-weight: 800;
text-decoration: none;
color: inherit;
text-align: center;
}
.navbar .content img {
height: 100%;
}
@supports not (-ms-high-contrast: none) {
.navbar .content {
margin: auto;
width: 80%;
height: 100%;
font-family: var(--main-font, sans-serif);
font-size: 1.3em;
font-weight: 800;
text-decoration: none;
color: inherit;
text-align: center;
}
}
@media screen and (min-width: 700px) {
.navbar .content {
text-align: unset;
}
*::-ms-backdrop, .navbar .content {
text-align: left;
}
}
@media screen and (min-width: 800px) {
.navbar {
-webkit-box-pack: left;
-webkit-justify-content: left;
-moz-box-pack: left;
-ms-flex-pack: left;
justify-content: left;
}
}
</style>
</head>
<body>
<HEADER class="navbar">
<A class="content">
<IMG alt="Education Transformation Centre Logo" src="logo.png">
</A>
</HEADER>
</body>
</html>
注意:建议你将以上代码保存到HTML文件中,修改logo的路径,尝试在IE 11浏览器中运行。
IE 11 中的输出:
在使用 IE 11 浏览器对其进行测试后,您可以尝试在您的原始代码中实现它以解决问题。此外,您可以尝试根据自己的需求修改代码。