您好我有一个小的媒体查询问题。我正在处理的网站上的徽标在移动设备上不会调整大小。所以我尝试添加下面的代码,但它没有做任何事情。有没有办法设置它,以便它也适用于移动设备?
link:http://eyeandretina.com.au/
.header_left a img
{
float: left;
margin-right: 20px;
width:612px;
}
media {
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
.header_left a img {
width:100px;
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
/* Styles */ .header_left a img {
width:100px;
}
}
/* Smartphones (portrait) ----------- */
@media only screen
and (max-width : 320px) {
/* Styles */ .header_left a img {
width:100px;
}
}
/* iPads (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px) {
/* Styles */ .header_left a img {
width:100%;
}
}
/* iPads (landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape) {
/* Styles */ .header_left a img {
width:100%;
}
}
/* iPads (portrait) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait) {
/* Styles */ .header_left a img {
width:100px;
}
}
/* Desktops and laptops ----------- */
@media only screen
and (min-width : 1224px) {
/* Styles */ .header_left a img {
width:100%;
}
}
/* Large screens ----------- */
@media only screen
and (min-width : 1824px) {
/* Styles */ .header_left a img {
width:100px;
}
}
/* iPhone 4 ----------- */
@media
only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {
/* Styles */
.header_left a img {
width:100px;
}
}
答案 0 :(得分:1)
只需查看您的网站链接即可找到 你的这个css没有打电话
http://eyeandretina.com.au/wp-content/themes/medicenter/style/responsive.css?ver=4.1
这个css正在覆盖你当前的CSS。
尝试在此responsive.css中执行所有代码,或将style.css作为优先级
http://eyeandretina.com.au/wp-content/themes/medicenter/style.css?ver=4.1