我在 iphone safari 瀏覽器的 HTML 和 CSS 網站中獲得放大的徽標影像。因為我已經使用媒體查詢在 css 中設定了寬度和高度,但我仍然只在 iphone 上而不是在 android 上遇到這個問題。
截圖影像
請訪問此鏈接以獲取代碼和相關檔案:https ://github.com/abhijeetjain101/Portfolio-Website
@media only screen and (max-width: 480px){
.logo {
max-height: 20%;
max-width: 40%;
width: 50px;
height: 40px;
}
uj5u.com熱心網友回復:
您是否檢查過螢屏尺寸是否適用于您的實際 iPhone,有時它們可??能會相差 1px
*{
margin: 0px;
padding: 0px;
}
/* Small phones line iPhone 5 SE */
@media screen and (max-width:374px) {
}
/* Regular phones like Iphone X */
@media only screen and (min-width:375px) {
}
/* landscape mobile devices */
@media only screen and (min-width:480px){
}
/* tablet portrait */
@media only screen and (min-width:768px){
}
/* tablet landscape */
@media only screen and (min-width:1024px){
}
/*Small Monitor Screen */
@media only screen and (min-width:1280px){}
/* med Monitor Screen */
@media only screen and (min-width:1440px){}
/* Large Monitor */
@media only screen and (min-width:1920px){}
這是我為 Web 開發的任何 CSS 腳本的起點,還請確保如果您正在使用影像大小的回應屬性,當您移動到新媒體查詢時,您可以根據螢屏需要向下或向上撥動
uj5u.com熱心網友回復:
只需在樣式中給出此代碼 img{width:100%;}
uj5u.com熱心網友回復:
只需給出影像的最小和最大寬度,否則使用 % 代替 px 這可能會有所幫助
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/415983.html
標籤:
