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

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.

主站蜘蛛池模板: 巴林右旗| 平阴县| 融水| 咸丰县| 曲水县| 昌平区| 冀州市| 承德市| 友谊县| 黑龙江省| 靖安县| 砀山县| 建始县| 济阳县| 来凤县| 北安市| 彰化县| 西宁市| 盐亭县| 临清市| 牡丹江市| 涟水县| 怀柔区| 广东省| 江西省| 霍林郭勒市| 仪征市| 布拖县| 布拖县| 北京市| 大安市| 黎城县| 呼和浩特市| 黄石市| 柳州市| 高州市| 榆林市| 西城区| 高雄县| 北辰区| 唐山市|