【问题标题】:HTML5 in IE11 not working properly but good in chromeIE11 中的 HTML5 无法正常工作,但在 chrome 中运行良好
【发布时间】:2015-06-19 02:12:32
【问题描述】:

我已经开始学习 HTML5。我面临的主要问题是在不同的浏览器/版本中以不同的方式工作。特别是在 IE 中很难工作。 下面是我的代码 sn-p,它在 chrome 中运行完美,但在 IE11 中运行良好。

我有两个版本的 IE,IE8 和 IE11。我想在 IE 的不同版本中运行相同的版本,并且知道其中的技巧/调整。

<!doctype html>
<html>
<head>
    <title>Web Forms API</title>
    <style>
        label {
            margin-top: 20px;
            display: block;
        }

        input {
            width: 200px;
        }

            input[type=submit] {
                width: auto;
            }

        .col {
            display: table-cell;
            width: 300px;
        }
    </style>
</head>
<body>


    <form method="post" action="NewURL"> 
      <label for="yearsInDev">Number Demo:</label>
            <input type="number" name="MyNuberElement" id="MyNumberElement" />

            <label for="devExperienceRange">Range Demo:</label>
            <input type="range" name="MyRangeElement" id="MyRangeElement"/>

            <label for="bgcolor">Color Demo</label>
            <input type="color" id="MyColorElement" name="MyColorElement" />

            <label for="arrivalDate">Date Demo</label>
            <input type="date" id="MyDateElement" name="MyDateElement" />

            <label id="arrivalTime">Time Demo</label>
            <input type="time" id="MyTimeElement" name="MyTimeElement"/>


            <label for="arrivalDTLocal">DateTime Local Demo</label>
            <input type="datetime-local" id="MyDateTimeLElement" name="MyDateTimeLElement" />

            <label id="arrivalDT">DateTime Demo</label>
            <input type="datetime" id="MyDateTimeElement" name="MyDateTimeElement" />


            <label for="birthMonth">Birth Month</label>
            <input type="month" id="MyMonthElement" name="MyMonthElement" autofocus />

            <label for="vacationWeek">Vacation Week</label>
            <input type="week" id="MyWeekElement" name="MyWeekElement" />

            <input type="text" placeholder="Enter Value" id="MyPlaceHolderControl" 
               name="MyPlaceHolderControl" autocomplete="on" />

        <input type="submit" value="Go!" />
        <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
    </form>

</body>
</html>

请帮忙

【问题讨论】:

  • 请定义“不工作”。
  • 这在 IE8 中永远不会工作。现在,除此之外,大多数更高级的输入类型都是not supported by any IE。所以,我不想这么说,但你给自己设定了一个不可能实现的目标。
  • 已说明无法使用屏幕截图。如果有机会请查看。
  • @BoristheSpider - 感谢您的意见。有什么方法可以知道浏览器到浏览器、版本到版本的限制
  • 是的,我发布的链接。

标签: html google-chrome internet-explorer


【解决方案1】:

当你处理不同的浏览器时,

  • 您也可以使用 reset.css ,它会刷新浏览器上的所有样式,您可以自己设置所有样式
  • 你可以使用 webkit
 filter:progid:DXImageTransform.Microsoft.gradient( ... );/* IE8- */
  width: -ms-linear-gradient(200px); /* IE10+ */
  width: -webkit-linear-gradient(200px); /* For Safari 5.1 to 6.0 */
  width: -o-linear-gradient(200px); /* For Opera 11.1 to 12.0 */
  width: -moz-linear-gradient(200px); /* For Firefox 3.6 to 15 */
  width: linear-gradient(200px); /* Standard syntax */

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-22
    • 2017-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-27
    相关资源
    最近更新 更多