Now there are tools to do the conversion we can not need to calculate the various units, cut the image directly with PX, and then after the page cut, the style is thrown into the tool for conversion, in seconds can be the style of all PX units into REM.
First step: Add the root element to the page to calculate the JS code
(Function (doc, win) { var docel = doc.documentelement, resizeevt = ' orientationchange ' in window? ' Orientationchange ': ' Resize ', recalc = function () { var clientwidth = docel.clientwidth; if (!clientwidth) return; docEl.style.fontSize = * (clientwidth/320) + ' px '; }; if (!doc.addeventlistener) return; Win.addeventlistener (Resizeevt, Recalc, false); Doc.addeventlistener (' domcontentloaded ', Recalc, False);}) (document, window);
Step two: Drop the CSS file you have written into the tool for conversion.
Here to explain why the various properties of the border is not processed, because border in the use of REM units under the support of the special poor, you may write 2rem or 3rem is useless by default will become 1px, so when using the border attribute is often not recommended to handle border.
Tool Address: Http://520ued.com/tools/rem
Tool guide for PX conversion into REM