0

我有一个特定的 WordPress 页面,当在移动设备上查看它时,我需要以更大的字体显示它。我想过这样做:

@media handheld { /* rules for handheld devices */ }

...但是看不到我可以将其放入页面标题的位置。对我来说最简单的方法是什么?

4

2 回答 2

0

media="only screen and (max-width: 480px), only screen and (max-device-width: 480px)" href="/assets/css/small-device.css"

http://mobile.smashingmagazine.com/2010/07/19/how-to-use-css3-media-queries-to-create-a-mobile-version-of-your-website/

于 2013-03-18T16:22:09.743 回答
0

如果您想在 wordpress 中定位特定页面,您可以这样做。

在您的header.php中添加此代码而不是开始<body>标记

<body <?php $id = get_the_ID(); $title = str_replace(' ','-', strtolower(get_the_title($id)));  body_class($title); ?>>

这将获取页面的标题,使其全部小写并添加破折号而不是空格。

因此,如果您有一个名为The Neighborhood的页面,那么您现在有一个名为.the-neighborhood

在你的主style.css页面中定位它

@media handheld { 
   body.the-neighborhood header {
      /*header styles for only the neighborhood page */
    }
}
于 2013-03-18T17:14:49.187 回答