[英]How to edit a HTML theme's mobile version?
您可以使用的是媒體查詢,其語法如下所示:
@media <What to respond to> {
//then place the elements, class and id here
}
媒體查詢可以通過執行@media (max-width:<insert width here>)
或@media(min-width:<insert width here>)
可以像@media (max-width:100px) and (min-width:50px)
這樣一起使用多個媒體查詢。
另一類媒體查詢可用於指定如何根據設備類型運行,它們包括但不限於:
通過鍵入@media <name of device>
來使用它們。
我提到的其中一些東西被使用的示例
@media screen and (max-width: 100px) and (min-width: 50px) {
//If the device is a screen, is wider/equal to 50px but smaller
//than or equal to 100 then it will do this
img {
width: 75px;
height: 30px;} }
@media screen and (max-width: 400px) and (min-width: 101px) {
//I'm sure what will happen but i will tell you anyway
//If the device is a screen, is wider than/equal to 101px but
//smaller than/equal 400px
img { //Something
}}
我的建議是閱讀起來就可以看看這里
有很多方法可以解決您的問題。 一種方法是使用媒體查詢更改背景。 這是通過編輯CSS文件來完成的。 如果您有多個CSS文件,則需要知道哪個文件正在設置背景圖片,並將媒體查詢放置在其中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.