Google Technical Advice On Making A Static Web Page Mobile/Responsive Friendly

Mar 23, 2015 - 8:22 am 8 by

Static TVOld legacy sites are honestly one of the hardest web sites to make mobile-friendly. New web sites that are custom built or running off a popular CMS are relatively easy to convert but old static web sites are a real pain.

Zineb Ait Bahajji from Google posted in the Google Webmaster Help forums detailed technical advice on how to go about making your static web pages responsive/mobile friendly for the upcoming mobile-friendly algorithm.

The tips are details and advanced but again, static web sites require you to update every single page individually, which will be time consuming and leave areas for many errors and glitches, so be careful.

Here is her advice:

If you can't migrate your site to a CMS, here are some suggestions on how you can rewrite your site to be mobile-friendly. This is a non-exhaustive (but very long) list of advice, but we hope it will provide you with a starting point:

  • Use Chrome Device Emulation Mode to test your website on different screen sizes and resolutions.
  • Configure the Viewport. This tag will help scale the content of your page to fit with different screens. Without the Viewport, your content will be displayed as if it was on a desktop.
  • Consider using CSS instead of <font> and other inline HTML elements.
  • If you see a page that is too wide, it's probably caused by some HTML element that is too wide. You should use HTML elements with CSS that know how to float and resize themselves. You can visit our PageSpeed Insights page to learn more about how to optimize CSS delivery.
  • Remove all fixed-pixel width (e.g. <table width=600>), and replace them with either relative width (e.g. <table width="80%">), max width (<table style="max-width:600px;">), or responsive width based on media query.
  • Add img { max-width:100% } to the stylesheet. This is an easy way to deal with wide images, making all wide images shrunk within the device width.
  • Avoid using <table> to layout a page. Use <table> for real tables only. If you already have <table> layout, firstly convert it to div + CSS floats/inline-blocks to be rendered nicely in desktop. After that, add media queries to make it responsive. To see more details and examples about creating responsive layout, check Responsive Web Design Basics and Patterns in Web Fundamentals.
  • Avoid wide tables (tables with 3-4 columns or more); they cannot be fit into mobile screens. If you already use such tables on your website, we recommend that you modify them (e.g. transpose the table), or that you convert your code to a style without a table (such as <dl>).
  • Get rid of <pre> tags when possible, because it often makes the page wider. The way depends on the content of these tags:
    • For formatted texts, use CSS margin, padding, text-indent, etc.
    • For tables, use <table>. Please also follow the above instruction about wide tables.
    • For fixed-width fonts, use CSS font-family:monospace.
    • For others that really need to preserve whitespace (e.g. computer code), it's OK to use <pre> but add style="overflow:auto;" to allow horizontal scrolling within the pre box.
  • Add DOCTYPE declaration for users using old desktop browsers, such as Internet Explorer 8. Without a correct DOCTYPE at the top of HTML, some desktop browsers enter "Quirks mode" and render in a non-standard way. Using a DOCTYPE declaration makes them follow the standard, so you're less likely to get strange rendering in old browsers.
  • Do not use Flash or other plugins that are not commonly supported on mobile.
Forum discussion at Google Webmaster Help.

 

Popular Categories

The Pulse of the search community

Follow

Search Video Recaps

 
Google Core Update Rumbling, Manual Actions FAQs, Core Web Vitals Updates, AI, Bing, Ads &amp; More - YouTube
Video Details More Videos Subscribe to Videos

Most Recent Articles

Search Forum Recap

Daily Search Forum Recap: March 18, 2024

Mar 18, 2024 - 4:00 pm
Google Updates

Google Urges Patience As The March 2024 Core Update Continues To Rollout

Mar 18, 2024 - 7:51 am
Google

Official: Google Replaces Perspective Filter With Forums Filter

Mar 18, 2024 - 7:41 am
Google Maps

Google Business Profiles Now Offers Additional Review After Appeal Is Denied

Mar 18, 2024 - 7:31 am
Google Maps

EU Searchers Complaining About Google Maps Features Changes Related To DMA

Mar 18, 2024 - 7:21 am
Google

Google Showing Fewer Sitelinks Within Search

Mar 18, 2024 - 7:11 am
Previous Story: Google Adds Mobile Ranking Banner To Webmaster Blogs