remcss原生適合案

2888 ワード

less     less     :

  :@import "       .less";

  :

		    UI     :@my_UI

		    UI     :@fs

		       :@size

				      :@size : @my_UI / @fs



	   :    :400px   UI       640px   10  

   html  :

    	<div></div>

	css  :

     @UI_my: 640px;
     @fs:10;
     @size: @UI_my / @fs;
    
     @media (width:400px){
     
    		//         
            html{
     
    				font-size : 400px / @fs;
    		    }
     }
    div{
     

  			width: 100rem / @size;

  		   height: 100rem / @size;

  	   background: red;

    	}

  html       40px

   400px     div      100*40 / 64 = 62.5px

62.5px / html    = 1.5625rem (UI    400px         )