官术网_书友最值得收藏!

Mobile themes versus responsive themes

In the past, most site owners who wanted a mobile-friendly site would use a separate mobile theme for the site with a design specifically for mobile devices. Some would also use different mobile domains. In fact, this is what those plugins we learned about in the last chapter are doing.

If you’re using a mobile theme, you tell WordPress to switch themes if the visitor is using a mobile, and stick to the desktop theme if he/she’s using a—yes you’ve guessed it—desktop PC.

A responsive theme, on the other hand, uses the same theme and similar styling for both sites, but uses a combination of a fluid layout and media queries to make the layout and content different on different-sized devices. It doesn’t just work for mobiles; responsive themes can change the look of a site on tablets or on really large screens, too.

Tip

Responsive design—key terminology

To get to grips with a responsive design, you’ll need to understand the following:

  • Fluid layout: This is a site layout that uses percentages for widths instead of pixels. The effect of this is that when the browser window changes width, so does the site.
  • Media queries: We use media queries to add extra changes to the CSS for devices of a particular width. The widths most commonly targeted are:
    • Mobile devices such as smartphones: These are 320px wide and 480px high, which means the width of the screen will change when the device is turned around.
    • Tablet devices: These vary in size but the screen on the iPad, which is by far the most commonly used, is 768px wide by 1024px high. Other tablets such as the Kindle Fire will be smaller.
    • Desktop computers: Their width ranges from 1024px and above. It’s common to set a maximum width for our layout so that on very large screens (for example, over 1200px), the site doesn’t lay out so far that it makes the content difficult to read.

We’ll get under the hood of the responsive design in the next chapter, and see exactly what the code is that makes a theme responsive. For now, we’ll just be looking at some that you can download and use straightaway.

主站蜘蛛池模板: 渭源县| 宁强县| 团风县| 孙吴县| 大竹县| 旬邑县| 遂平县| 丰都县| 黔江区| 龙陵县| 镇坪县| 商洛市| 揭西县| 绍兴市| 张家川| 海安县| 大名县| 开化县| 奎屯市| 巫溪县| 阿坝| 察隅县| 肥城市| 平定县| 天全县| 磴口县| 哈巴河县| 泾阳县| 阿荣旗| 宾川县| 赞皇县| 崇阳县| 宜君县| 瓦房店市| 托里县| 遵化市| 东港市| 武鸣县| 潮州市| 江达县| 白玉县|