html - @MediaQuery 在 CSS 中调用

标签 html css wordpress stylesheet media-queries

我一直在调整网站以使其更具响应性,并且我一直在关注发送给我的演示中的代码。

但是由于某种原因,它似乎并没有像移动浏览器中所说的那样调整大小。

我认为这是因为 Wordpress 调用样式表的方式略有不同,我需要某种形式的插件来做到这一点吗?

请看下面我的文档的标题引用了其他样式表,但是当浏览器不同时它似乎没有调用它(但是它在不同的分辨率下有效地调整大小)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>
<meta name="keywords" content="Holiday, free CSS template, clean, neat, aqua, white, templatemo" />
<meta name="description" content="Holiday is a clean and neat free CSS template using aqua and white colors." />
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" />
<!-- Include jQuery -->
<?php wp_enqueue_script('jquery'); ?>
<?php wp_head(); ?>
<!-- Include the Nivo Slider CSS file -->
<link rel="stylesheet" href="<?php bloginfo("template_url"); >/scripts/nivoslider/nivo-slider.css" type="text/css" media="screen" />
<!-- Include the Nivo Slider JS file -->
<script src="<?php bloginfo("template_url"); ?>/scripts/nivoslider/jquery.nivo.slider.js" type="text/javascript"></script>
<!-- Set up the Nivo Slider -->
<script type="text/javascript">
jQuery(window).load(function() {
jQuery('#slider').nivoSlider();
});
</script>
<!-- media queries css -->
<link href="media-queries.css" rel="stylesheet" type="text/css">

<!-- html5.js for IE less than 9 -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<!-- css3-mediaqueries.js for IE less than 9 -->
<!--[if lt IE 9]>
<script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
<![endif]-->
</head>

最佳答案

您确定您的 media-queries.css 路径正确吗?首先确保 CSS 正在加载,然后我们可以开始讨论实际的媒体查询本身。

如果您的文件在 themes 文件夹中,那么它将类似于:

/wp-content/themes/media-queries.css

或者:

<link href="<?php bloginfo('template_url'); ?>/media-queries.css" 
    rel="stylesheet" type="text/css" media="screen" />

关于html - @MediaQuery 在 CSS 中调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13375127/

相关文章:

html - 在 CSS 中堆叠的可扩展方式

html - 在 HTML/CSS 中构造更清晰的元素的最佳方法是什么?

css - 导航菜单高度不一致

javascript - WordPress:我可以启动在同一页面上声明的小型 JavaScript 吗?或者如何将 .js 文件上传到 Wordpress?

wordpress - 通过CSS将标题放在前面

php - 无论如何都不能将我的网站图像转换为双语吗?

javascript - 为什么我的图像不断覆盖自身而不是在 for 循环中显示每个图像?

javascript - 如何使用javascript更改表中的元素

jquery - 显示包含多列选项的下拉列表

css - 使用 css 隐藏和显示元素