css - Wordpress 移动设备 Logo 调整大小

标签 css media

您好,我遇到了一个小的媒体查询问题。我正在使用的网站上的 Logo 在移动设备上不会调整大小。所以我尝试添加下面的代码,但它什么也没做。有没有办法设置它以便它也可以在移动设备上工作?

链接: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;
    } 
}

最佳答案

只是通过你的网站链接,我发现 你的这个 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

关于css - Wordpress 移动设备 Logo 调整大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27700490/

相关文章:

css - @media 适用于 Chrome 和 Safari,但不适用于 Firefox 和 IE

java - 为什么我得到 "the import javax.media cannot be resolved"?

css - 如何保持页面背景图片缩放固定? CSS

css - 使用带有 Angular 7 的 ng-ui-switch

html - 悬停后如何继续CSS动画?

CSS - flex 布局,1 个流体 + 1 个固定列,居中对齐

flash - Adobe Flash CS4中的音频文件膨胀

jquery - 用jquery删除一定宽度的div

javascript - for 循环中的 jQuery .append()

javascript - 如何使用javascript或jquery单击一个按钮,使多个mp3文件一个接一个地播放?