alert
(window.screen.width)
;//web
@media screen and (
min-width
:769px)
下面是一些**的適配,最**的具體寬度各位童鞋可以自行搜尋一下哈,畢竟手機也是一年發布一堆,根據自身業務情況設定哈
pad pro && ipad 就設定 mini 768px
@media screen and (
max-width
: 768px) and (
min-width
:481px)
android 6.4inch 480px
@media screen and (
max-width
: 480px) and (
min-width
:415px)
android 360px
@media screen and (
max-width
: 320px)
iphone plus 414px
@media screen and (
max-width
: 414px) and (
min-width
:361px)
//iphone 320px
@media screen and (
max-width
: 320px)
根據解析度改變寬度 demo
doctype html html head meta charset utf 8 title title style abc media screen and min width 1201px 設定了瀏覽器寬度不小於1201px時 abc 顯示1200px寬度 media screen and m...
根據解析度改變寬度 demo
doctype html html head meta charset utf 8 title title style abc media screen and min width 1201px 設定了瀏覽器寬度不小於1201px時 abc 顯示1200px寬度 media screen and m...
Rails 根據 user agent 判斷請求端
要根據請求端的不同而返回不同的頁面,首先就得判斷出請求端是pc還是mobile。在http請求時,user agent這個欄位會記錄使用者所用的裝置和瀏覽器。所以就得對user agent進行解析,來獲取是什麼裝置。1 在rails專案中,要用到useragent 這個gem 包 輸入終端命令 ge...