【问题标题】:I want a text box appear when my client is using only IE 11 to open my website [closed]当我的客户仅使用 IE 11 打开我的网站时,我希望出现一个文本框 [关闭]
【发布时间】:2019-01-01 04:25:28
【问题描述】:

我希望在用户或客户端使用 IE 11 打开我的网站时出现一个文本框,同时我正在尝试解决我的代码中的问题。

或者,如果您有解决我问题的想法,请在 stackoverflow 上写信到我的收件箱。 (IE 11 杀了我……)

如您所见,问题是当您在 IE 上打开它时,它会使图像变成全尺寸,而 ie 中的控制台对我没有太大帮助。

代码 html

<!doctype html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
<meta charset="UTF-8">
<title>News | Designplace</title>
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<link href="CSS/Navigation.css" rel="stylesheet" type="text/css">
<link href="CSS/Content.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="NavScript.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">

<body>
<div class="sidenav" id="mySidenav">
<a href="/" id="homelink"></a>
<a href="news.html" id="news" class="active"></a>
<a href="contact.html" id="contact"></a>
<a href="about.html" id="about"></a>
<!--<a href="nav.html">NAv</a>-->
</div>
<div class="sidenav_small" id="mySidenav_small">
<a href="/" id="homelink"></a>
<a href="news.html" id="news" class="active"></a>
<a href="contact.html" id="contact"></a>
<a href="about.html" id="about"></a>
</div>
<div class="sidenav_icon" id="mySidenav_icon">
    <a href="javascript:void(0);" style="font-size:40px;" class="icon" onclick="myFunction()">&#9776;</a>
</div>
<div class="latest">
<h2 class="latest_news">Latest News</h2>
<a href="all_news"><h4 class="more">More...</h4></a>
<div class="table">
    <div class="tr">
        <div class="td">
            <a class="img_link" href="/art/news/00004/Review-af-macos-Mojave-public-beta.html">
                <img src="https://www.catster.com/wp-content/uploads/2017/08/A-fluffy-cat-looking-funny-surprised-or-concerned.jpg" alt="macOS">
                <div class="inner">
                    <h3>Review af macOS Mojave beta: God men ikke perfekt.
                    </h3>
                </div>
            </a>
        </div>

        <div class="th"></div>

        <div class="td">
            <a class="img_link" href="/art/news/00002/206-400-danskere-har-downloadet-ny-nemid-app-i-foerste-doegn-efter-lancering.html">
                <img src="https://www.catster.com/wp-content/uploads/2017/08/A-fluffy-cat-looking-funny-surprised-or-concerned.jpg" alt="NemID">
                <div class="inner">
                    <h3>206.400 danskere har downloadet ny NemID-app i første døgn efter lancering.
                    </h3>
                </div>
            </a>
        </div>

        <div class="th"></div>

        <div class="td">
            <a class="img_link" href="/art/news/00001/hands-on-nokias-spritnye-foraarskollektion-viser-at-billige-smartphones-ikke-behoever-at-vaere-tarvelige.html">
                <img src="https://www.catster.com/wp-content/uploads/2017/08/A-fluffy-cat-looking-funny-surprised-or-concerned.jpg" alt="Nokia telefon">
                <div class="inner">
                    <h3>Hands-on: Nokias spritnye forårskollektion viser, at billige smartphones ikke behøver at være tarvelige.
                    </h3>
                </div>
            </a>
        </div>
</div>
</div>
</body>
</head>
</html>

CSS

@charset "UTF-8";
html, body {
height: 100%;
}
.object {
height: 100%;
width: 100%;
}
.table {
display: table;
width: 100%;
}
.tr {
display: table-row;
}
.td {
display: table-cell;
/*border: 1px solid #ccc;*/
padding: 2px;
width: 31.1%
}
@media screen and (max-width: 400px) {
body {
  background-color: #596770;
    margin-left: 0px; /* Same as the width of the sidenav */
    margin-top: 102.5px;
    font-size: 18px; /* Increased text to enable scrolling */
     padding: 0px 52px 0px 52px;
    /*font-size: 35;*/
    color:white;
  font-family: montserrat, sans-serif;
}

.latest img {
    max-width: 100%;

}
.About {
    margin: -45px -52px 0px -52px;
}
    .warning {
    font-size: 40px;
    text-align: center;
    margin: -10px
}
    .about-line {
    margin: 30px;
}
.experimental {
    text-align: center;
    font-size: 14px;
}
    .td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
text-decoration: none;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */        
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
    color: white;
    text-decoration: none;
}
    .more {
    float: right;
    margin-top: -45px;
    color:white;
}
    .more:hover {
    text-decoration: underline;
    }
    td {
    padding: 5px 8px 5px;
}
table {
    width:100%;
}
thead {
    display: none;
}
tr:nth-of-type(2n) {
    background-color: inherit;
}
tr td:first-child {
    /*background: #f0f0f0;*/
    font-weight:normal;
    font-size:1.3em;
}
tbody td {
    display: block;  
    text-align:left;
}
tbody td:before { 
    content: attr(data-th); 
    display: block;
    text-align:left;  
    font-weight: normal;
}
tbody td::before {
    content: attr(data-th);
    display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
    font-size: 13px;
    min-height: 50%;
}
.columnrow {
    padding: 10px 0px 10px 0px;
    display:flex;

}
.contentimage {
    Float:left;
    width:20%;
    margin-right: 20px;
}
        .infoline {
    font-size: 13px;
}
        .article_img {
    width: 100%
}
.article {
    margin: 0% 15%;
}
.article_infoline {
    font-size: 12px;
}
    .article_teaser {
    font-size: 18px;
    margin-bottom: 10px;
}
.article_title {
    margin-bottom: 3px;
}
.article_line {
    margin: 30px 0px;
}
.article_image_text {
    font-size: 14px;
    margin-top: 0px;
}
}
@media screen and (min-width: 401px) and (max-width:600px) {
    body {
  background-color: #596770;
    margin-left: 0px; /* Same as the width of the sidenav */
    margin-top: 102.5px;
    font-size: 18px; /* Increased text to enable scrolling */
     padding: 0px 52px 0px 52px;
    /*font-size: 35;*/
    color:white;
  font-family: montserrat, sans-serif;
}
th {
    width: 423px;
    height: 273px;
}
.latest img {
    max-width: 100%;

}
.About {
    margin: -45px -52px 0px -52px;
}
.warning {
    font-size: 50px;
    text-align: center;
    margin: -10px;
}
.about-line {
    margin: 30px;
}
.experimental {
    text-align: center;
    font-size: 18px;
}
    .td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */        
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
    color: white;
    text-decoration: none;
}
    .more {
    float: right;
    margin-top: -45px;
    color:white;
}
    .more:hover {
    text-decoration: underline;
    }
    td {
    padding: 5px 8px 5px;
}
table {
    width:100%;
}
thead {
    display: none;
}
tr:nth-of-type(2n) {
    background-color: inherit;
}
tr td:first-child {
    /*background: #f0f0f0;*/
    font-weight:normal;
    font-size:1.3em;
}
tbody td {
    display: block;  
    text-align:left;
}
tbody td:before { 
    content: attr(data-th); 
    display: block;
    text-align:left;  
    font-weight: normal;
}
tbody td::before {
    content: attr(data-th);
    display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
    font-size: 13px;
    min-height: 50%;
}
.columnrow {
    padding: 10px 0px 10px 0px;
    display:flex;

}
.contentimage {
    Float:left;
    width:20%;
    margin-right: 20px;
}
        .infoline {
    font-size: 13px;
}
        .article_img {
    width: 100%
}
.article {
    margin: 0% 15%;
}
.article_infoline {
    font-size: 12px;
}
    .article_teaser {
    font-size: 18px;
    margin-bottom: 10px;
}
.article_title {
    margin-bottom: 3px;
}
.article_line {
    margin: 30px 0px;
}
.article_image_text {
    font-size: 14px;
    margin-top: 0px;
}
}
@media screen and (min-width: 601px) and (max-width: 720px) {
body {
  background-color: #596770;
    margin-left: 0px; /* Same as the width of the sidenav */
    margin-top: 102.5px;
    font-size: 18px; /* Increased text to enable scrolling */
     padding: 0px 52px 0px 52px;
    /*font-size: 35;*/
    color:white;
  font-family: montserrat, sans-serif;
}
th {
    width: 423px;
    height: 273px;
}
.latest img {
    max-width: 100%;

}
.About {
    margin: -45px -52px 0px -52px;
}
.warning {
    font-size: 70px;
    text-align: center;
    margin: -10px;
}
.about-line {
    margin: 30px;
}
.experimental {
    text-align: center;
    font-size: 24px;
}
    .td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */        
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
    color: white;
    text-decoration: none;
}
    .more {
    float: right;
    margin-top: -45px;
    color:white;
}
    .more:hover {
    text-decoration: underline;
    }
    td {
    padding: 5px 8px 5px;
}
table {
    width:100%;
}
thead {
    display: none;
}
tr:nth-of-type(2n) {
    background-color: inherit;
}
tr td:first-child {
    /*background: #f0f0f0;*/
    font-weight:normal;
    font-size:1.3em;
}
tbody td {
    display: block;  
    text-align:left;
}
tbody td:before { 
    content: attr(data-th); 
    display: block;
    text-align:left;  
    font-weight: normal;
}
tbody td::before {
    content: attr(data-th);
    display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
    font-size: 13px;
    min-height: 50%;
}
.columnrow {
    padding: 10px 0px 10px 0px;
    display:flex;

}
.contentimage {
    Float:left;
    width:20%;
    margin-right: 20px;
}
        .infoline {
    font-size: 13px;
}
        .article_img {
    width: 100%
}
.article {
    margin: 0% 15%;
}
.article_infoline {
    font-size: 12px;
}
    .article_teaser {
    font-size: 18px;
    margin-bottom: 10px;
}
.article_title {
    margin-bottom: 3px;
}
.article_line {
    margin: 30px 0px;
}
.article_image_text {
    font-size: 14px;
    margin-top: 0px;
}
}
@media screen and (min-width:720px) and
(max-width:750px) {
   body {
  background-color: #596770;
    margin-left: 0px; /* Same as the width of the sidenav */
    margin-top: 102.5px;
    font-size: 18px; /* Increased text to enable scrolling */
     padding: 0px 52px 0px 52px;
    /*font-size: 35;*/
    color:white;
  font-family: montserrat, sans-serif;
}
.latest img {
    max-width: 100%;

}
.About {
    margin: -45px -52px 0px -52px;
}
    .warning {
    font-size: 80px;
    text-align: center;
    margin: -10px
}
    .about-line {
    margin: 30px;
}
.experimental {
    text-align: center;
}
    .td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */        
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
    color: white;
    text-decoration: none;
}
.more {
    float: right;
    margin-top: -45px;
    color:white;
}
    .more:hover {
    text-decoration: underline;
    }
    td {
    padding: 5px 8px 5px;
}
table {
    width:100%;
}
thead {
    display: none;
}
tr:nth-of-type(2n) {
    background-color: inherit;
}
tr td:first-child {
    /*background: #f0f0f0;*/
    font-weight:normal;
    font-size:1.3em;
}
tbody td {
    display: block;  
    text-align:left;
}
tbody td:before { 
    content: attr(data-th); 
    display: block;
    text-align:left;  
    font-weight: normal;
}
tbody td::before {
    content: attr(data-th);
    display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
    font-size: 13px;
    height: 50%;
}
.columnrow {
    padding: 10px 0px 10px 0px;
    display:flex;

}
.contentimage {
    Float:left;
    width:29%;
    margin-right: 20px;
}
    .infoline {
    font-size: 13px;
}
        .article_img {
    width: 100%
}
.article {
    margin: 0% 15%;
}
.article_infoline {
    font-size: 12px;
}
    .article_teaser {
    font-size: 18px;
    margin-bottom: 10px;
}
.article_title {
    margin-bottom: 3px;
}
.article_line {
    margin: 30px 0px;
}
.article_image_text {
    font-size: 14px;
    margin-top: 0px;
}
}
@media screen and (min-width: 750px) and (max-width: 1280px) {
body {
  background-color: #596770;
    margin-left: 85px; /* Same as the width of the sidenav */
    margin-top: 102.5px;
    font-size: 18px; /* Increased text to enable scrolling */
     padding: 0px 52px 0px 52px;
    /*font-size: 35;*/
    color:white;
  font-family: montserrat, sans-serif;
}
.th {
    width: 20px;

}
.latest img {
    max-width: 100%;

}
.About {
    margin: -45px -52px 0px -52px;
}
    .warning {
    font-size: 80px;
    text-align: center;
    margin: -10px
}
    .about-line {
    margin: 30px;
}
.experimental {
    text-align: center;
}
    .td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */        
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
    color: white;
    text-decoration: none;
}
    .more {
    float: right;
    margin-top: -45px;
    color:white;
}
    .more:hover {
    text-decoration: underline;
    }
    td {
    padding: 5px 8px 5px;
}
table {
    width:100%;
}
thead {
    display: none;
}
tr:nth-of-type(2n) {
    background-color: inherit;
}
tr td:first-child {
    /*background: #f0f0f0;*/
    font-weight:normal;
    font-size:1.3em;
}
tbody td {
    display: block;  
    text-align:left;
}
tbody td:before { 
    content: attr(data-th); 
    display: block;
    text-align:left;  
    font-weight: normal;
}
tbody td::before {
    content: attr(data-th);
    display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.columnrow {
    padding: 10px 0px 10px 0px;
    display:flex;

}
.contentimage {
    Float:left;
    width:20%;
    margin-right: 20px;
}
    .teaser {
    font-size:70%;
    min-height: 50%;
    padding: 5px 0px 0px 0px
}
.infoline {
    font-size: 70%;
    color:white;
}
.article_img {
    width: 100%
}
.article {
    margin: 0% 15%;
}
.article_infoline {
    font-size: 12px;
}
    .article_teaser {
    font-size: 18px;
    margin-bottom: 10px;
}
.article_title {
    margin-bottom: 3px;
}
.article_line {
    margin: 30px 0px;
}
.article_image_text {
    font-size: 14px;
    margin-top: 0px;
}
}
@media screen and (min-width: 1281px) and (max-width: 1440px) {
body {
  background-color: #596770;
    margin-left: 85px; /* Same as the width of the sidenav */
    margin-top: 102.5px;
    font-size: 18px; /* Increased text to enable scrolling */
     padding: 0px 52px 0px 52px;
    /*font-size: 35;*/
    color:white;
  font-family: montserrat, sans-serif;
}
.latest img {
    max-width: 100%;

}
.About {
    margin: -45px -52px 0px -52px;
}
    .warning {
    font-size: 80px;
    text-align: center;
    margin: -10px
}
    .about-line {
    margin: 30px;
}
.experimental {
    text-align: center;
}
    .td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */        
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
    color: white;
    text-decoration: none;
}
.more {
    float: right;
    margin-top: -45px;
    color:white;
}
    .more:hover {
    text-decoration: underline;
    }
    td {
    padding: 5px 8px 5px;
}
table {
    width:100%;
}
thead {
    display: none;
}
tr:nth-of-type(2n) {
    background-color: inherit;
}
tr td:first-child {
    /*background: #f0f0f0;*/
    font-weight:normal;
    font-size:1.3em;
}
tbody td {
    display: block;  
    text-align:left;
}
tbody td:before { 
    content: attr(data-th); 
    display: block;
    text-align:left;  
    font-weight: normal;
}
tbody td::before {
    content: attr(data-th);
    display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
    font-size: 13px;
    height: 50%;
}
.columnrow {
    padding: 10px 0px 10px 0px;
    display:flex;

}
.contentimage {
    Float:left;
    width:29%;
    margin-right: 20px;
}
    .infoline {
    font-size: 13px;
}
    .article_img {
    width: 100%
}
.article {
    margin: 0% 15%;
}
.article_infoline {
    font-size: 12px;
}
    .article_teaser {
    font-size: 18px;
    margin-bottom: 10px;
}
.article_title {
    margin-bottom: 3px;
}
.article_line {
    margin: 30px 0px;
}
.article_image_text {
    font-size: 14px;
    margin-top: 0px;
}
}
@media screen and (min-width: 1441px) and (max-width:1920px) {
    body {
  background-color: #596770;
    margin-left: 85px; /* Same as the width of the sidenav */
    margin-top: 102.5px;
    font-size: 18px; /* Increased text to enable scrolling */
     padding: 0px 52px 0px 52px;
    /*font-size: 35;*/
    color:white;
  font-family: montserrat, sans-serif;
}
.latest img {
    max-width: 100%;

}
.About {
    margin: -45px -52px 0px -52px;
}
    .warning {
    font-size: 80px;
    text-align: center;
    margin: -10px
}
    .about-line {
    margin: 30px;
}
.experimental {
    text-align: center;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */        
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
    color: white;
    text-decoration: none;
}
.latest_news {
    width: 300px;
}
.more {
    float: right;
    margin-top: -45px;
    color:white;
}
.more:hover {
    text-decoration: underline;
    }
td {
    padding: 5px 8px 5px;
}
table {
    width:100%;
}
thead {
    display: none;
}
tr:nth-of-type(2n) {
    background-color: inherit;
}
tr td:first-child {
    /*background: #f0f0f0;*/
    font-weight:normal;
    font-size:1.3em;
}
tbody td {
    display: block;  
    text-align:left;
}
tbody td:before { 
    content: attr(data-th); 
    display: block;
    text-align:left;  
    font-weight: normal;
}
tbody td::before {
    content: attr(data-th);
    display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
    margin-top: 5px;
    font-size: 13px;
    min-height: 25%;
}
.columnrow {
    padding: 10px 0px 10px 0px;
    display:flex;

}
.contentimage {
    Float:left;
    width:22%;
    margin-right: 20px;
}
.infoline {
    font-size: 12px;
}
.article_img {
    width: 100%;
}
.article {
    margin: 0% 15%;
}
    .article_infoline {
    font-size: 12px;
}
    .article_teaser {
    font-size: 18px;
    margin-bottom: 10px;
}
.article_title {
    margin-bottom: 3px;
}
.article_line {
    margin: 30px 0px;
}
.article_image_text {
    font-size: 14px;
    margin-top: 0px;
}
}
@media screen and (min-width:1921px) and (max-width:2160px) {
        body {
  background-color: #596770;
    margin-left: 85px; /* Same as the width of the sidenav */
    margin-top: 102.5px;
    font-size: 18px; /* Increased text to enable scrolling */
     padding: 0px 52px 0px 52px;
    /*font-size: 35;*/
    color:white;
  font-family: montserrat, sans-serif;
}
.latest img {
    max-width: 100%;

}
.About {
    margin: -45px -52px 0px -52px;
}
    .warning {
    font-size: 80px;
    text-align: center;
    margin: -10px
}
    .about-line {
    margin: 30px;
}
.experimental {
    text-align: center;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */        
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
    color: white;
    text-decoration: none;
}
.latest_news {
    width: 300px;
}
.more {
    float: right;
    margin-top: -45px;
    color:white;
}
.more:hover {
    text-decoration: underline;
    }
td {
    padding: 5px 8px 5px;
}
table {
    width:100%;
}
thead {
    display: none;
}
tr:nth-of-type(2n) {
    background-color: inherit;
}
tr td:first-child {
    /*background: #f0f0f0;*/
    font-weight:normal;
    font-size:1.3em;
}
tbody td {
    display: block;  
    text-align:left;
}
tbody td:before { 
    content: attr(data-th); 
    display: block;
    text-align:left;  
    font-weight: normal;
}
tbody td::before {
    content: attr(data-th);
    display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
    font-size: 13px;
    min-height: 50%;
}
.columnrow {
    padding: 10px 0px 10px 0px;
    display:flex;

}
.contentimage {
    Float:left;
    width:19.5%;
    margin-right: 20px;
}
        .infoline {
    font-size: 13px;
}
        .article_img {
    width: 100%;
}
.article {
    margin: 0% 15%;
}
.article_infoline {
    font-size: 12px;
}
    .article_teaser {
    font-size: 18px;
    margin-bottom: 10px;
}
.article_title {
    margin-bottom: 3px;
}
.article_line {
    margin: 30px 0px;
}
.article_image_text {
    font-size: 14px;
    margin-top: 0px;
}
}
@media screen and (min-width:2160px) and (max-width:3840px) {
        body {
  background-color: #596770;
    margin-left: 85px; /* Same as the width of the sidenav */
    margin-top: 102.5px;
    font-size: 18px; /* Increased text to enable scrolling */
     padding: 0px 52px 0px 52px;
    /*font-size: 35;*/
    color:white;
  font-family: montserrat, sans-serif;
}
.latest img {
    max-width: 100%;

}
.About {
    margin: -45px -52px 0px -52px;
}
    .warning {
    font-size: 80px;
    text-align: center;
    margin: -10px
}
    .about-line {
    margin: 30px;
}
.experimental {
    text-align: center;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */        
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
    color: white;
    text-decoration: none;
}
.latest_news {
    width: 300px;
}
.more {
    float: right;
    margin-top: -45px;
    color:white;
}
.more:hover {
    text-decoration: underline;
    }
td {
    padding: 5px 8px 5px;
}
table {
    width:100%;
}
thead {
    display: none;
}
tr:nth-of-type(2n) {
    background-color: inherit;
}
tr td:first-child {
    /*background: #f0f0f0;*/
    font-weight:normal;
    font-size:1.3em;
}
tbody td {
    display: block;  
    text-align:left;
}
tbody td:before { 
    content: attr(data-th); 
    display: block;
    text-align:left;  
    font-weight: normal;
}
tbody td::before {
    content: attr(data-th);
    display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
    font-size: 13px;
    min-height: 50%;
}
.columnrow {
    padding: 10px 0px 10px 0px;
    display:flex;

}
.contentimage {
    Float:left;
    width:11%;
    margin-right: 20px;
}
        .infoline {
    font-size: 13px;
}
        .article_img {
    width: 100%;
}
.article {
    margin: 0% 15%;
}
.article_infoline {
    font-size: 12px;
}
    .article_teaser {
    font-size: 18px;
    margin-bottom: 10px;
}
.article_title {
    margin-bottom: 3px;
}
.article_line {
    margin: 30px 0px;
}
.article_image_text {
    font-size: 14px;
    margin-top: 0px;
}
}

编辑: 我将代码从 .Img 更改为 .Img_link > Img 并且可行,但如果有人有想法让 var isIE11 = !!window.MSInputMethodContext &amp;&amp; !!document.documentMode; 使用整个 javascript,我会很高兴,我对 javascript 还没有那么好。

我试过了:

function IncompatibleBrowser() {
var x = document.getElementById("simpleModal")
var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
if (true) {
    x.className += " Incompatible";
} else {
    x.className = "Compatible"
}
}

编辑 2:

好的,Zani 提供的代码有点用。我们浏览器中的控制台只检测 IE11 中的代码,这正是我想要的。但是代码报错了:

Script 5007: Unable to get property 'style' of undefined or null reference

这是 Zani 给出的代码。

<script type="text/javascript">
var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
    if(isIE11)
  document.getElementById("IDOfYourElement").style.display="block";
    </script>

【问题讨论】:

  • 请输入代码sn-p。
  • 到IE的问题?
  • ...解决我的问题 - 什么问题?
  • 这样更好吗?

标签: html css internet-explorer


【解决方案1】:

<script type="text/javascript">
   var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
        if(isIE11)
	  document.getElementById("IDOfYourElement").style.display="block";
        
</script>

提问前请先搜索。

Internet Explorer 11 detection

【讨论】:

  • 我确实搜索过,但我可以找到。这些只适用于 ie 8?
  • Internet Explorer 11 不支持 condcoms。对它们的支持在 IE 9 之后被放弃了。这不起作用。
  • 您是否可以帮助我让这个 javascript 正常工作?我对 javascript 还不是很好。如果我不正确,我必须使用该功能,但我必须写的是我希望你能帮助我......
  • 将编辑后的代码复制到head标签之间。
【解决方案2】:

您可以使用浏览器嗅探来定位 IE11。如您所知,这有其自身的缺点。

根据我的经验,IE11 并没有那么糟糕(与 IE8 或 Safari 相比)。因此,您的问题或一组问题很有可能得到处理。

请提出更具体的问题。

【讨论】:

  • 请查看我附上的代码
【解决方案3】:

IE没有问题。问题出在您的代码中。

请在您庞大的 CSS 中找到所有 .img {width:100%},并将它们替换为
img {width:100%}没有点)。

【讨论】:

  • 应该如何改变 ie 正在查看的内容?
  • @JessenJonas,这是不言自明的。 IE 会将width:100% 应用于img 元素,而不是应用于代码中不存在的class="img" 元素。所以它解决了你的问题。
  • 稍后我会检查的
  • 好吧,工作完美无缺,但如果 javascript 代码正常工作,如果再次出现问题,我会保存它以备后用。
猜你喜欢
  • 2012-02-25
  • 1970-01-01
  • 2019-05-22
  • 2016-07-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-03-01
相关资源
最近更新 更多