我已经从网络上下载了一个免费的HTML模板,我正在尝试编辑这个HTML主题。在我的主题中,我改变了背景照片,它在我的电脑上和我的分辨率(1366x768)上都很好,但在手机和其他分辨率上却不能很好地工作。背景图像正在崩溃。
请用您的电脑和手机访问该网站,以便更清楚地了解。Theme link
请帮我编辑这个网站的手机版。我什么也找不到。这是我在主题文件夹中的javascript文件列表。image of files
发布于 2014-12-12 03:48:43
您可以使用的是媒体查询,其语法如下所示:
@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
}}我的建议是仔细阅读它看看here
发布于 2014-12-12 03:42:41
有很多方法可以解决你的问题。一种方法是使用media queries更改背景。这可以通过编辑css文件来完成。如果你有多个css文件,你需要知道是哪一个设置了你的背景图像,并在其中放置了媒体查询。
https://stackoverflow.com/questions/27430959
复制相似问题