gpt4 book ai didi

javascript - Bootstrap 在 IE10 中仍未显示

转载 作者:行者123 更新时间:2023-11-28 00:21:27 25 4
gpt4 key购买 nike

我已经添加了建议的所有 Bootstrap 链接和脚本,清除了缓存,并将我的服务器添加到 IE 安全性中。 Bootstrap 元素仍然没有显示。我缺少什么?有人如何克服这个问题吗?

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7" content="IE=8" content="IE=9" content="IE=10" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title> JLB Artistry </title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<script src="https://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>

抱歉, Bootstrap 代码在代码块中无法正常工作,因此我不包括它。

最佳答案

我不是 100% 确定,但我相信您需要将其添加到对 Bootstrap 脚本进行排队的functions.php

/**
* Add Respond.js for IE
*/
if( !function_exists('ie_scripts')) {
function ie_scripts() {
echo '<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->';
echo ' <!-- WARNING: Respond.js doesn\'t work if you view the page via file:// -->';
echo ' <!--[if lt IE 9]>';
echo ' <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>';
echo ' <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>';
echo ' <![endif]-->';
}
add_action('wp_head', 'ie_scripts');
} // end if

从此处下载脚本并将其包含在您的主题中: https://github.com/scottjehl/Respond解压下载并将respond.min.js 文件移动到您的/js/目录

我也认为您不应该将这些 src 添加到 header 中。

我最近在我的主题中添加了 Bootstrap 支持,我唯一需要添加到标题中的是

<!--[if IE 8]>
<html id="ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 8) ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->

我推荐http://bootstrapwp.com TUT,但他们是有报酬的。但花的钱还是值得的!

在这里您可以阅读为什么不应该排队到 header.php http://wpshout.com/everything-custom-scripts-styles-wordpress/

关于javascript - Bootstrap 在 IE10 中仍未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29975775/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com