簡體   English   中英

Chrome for Android:如何在網頁上啟用適合移動設備的“

[英]Chrome for Android: How to enable mobile-friendly ' on web page

我使用CSS和CSS 3創建了這個http://nl4.christianity24.org/。它使用PHP和mysqli創建了網站。 我該怎么辦。

就像使用@media(); 移動視點的最佳CSS 3格式是什么?

為確保所有設備都能正確渲染和觸摸縮放,請嘗試在文檔的<head>中添加此meta標簽。

<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

然后,您可以使用各種媒體查詢來自定義您的網站。

// Large devices (desktops, less than 1200px)
@media (max-width: 1199.98px) {
    body {
        background-color: red;
    }
}

// Medium devices (tablets, less than 992px)
@media (max-width: 991.98px) {
    body {
        background-color: yellow;
    }
}

// Small devices (landscape phones, less than 768px)
@media (max-width: 767.98px) {
    body {
        background-color: blue;
    }
}

// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575.98px) {
    body {
        background-color: violet;
    }
}

希望這會有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM