Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 响应图像大小问题_Html_Css_Responsive Design - Fatal编程技术网

Html 响应图像大小问题

Html 响应图像大小问题,html,css,responsive-design,Html,Css,Responsive Design,不确定为什么标题图像没有正确调整大小。看 我认为我设置正确,但标题图像不会为移动设备调整大小。有什么建议吗 CSS: HTML: 从HTML中删除宽度和高度。HTML优先于您在CSS中定义的任何内容 编辑: 这是一种液体溶液 HTML <div id="wrap"> <div class="container-header-image"> <a href="http://www.insidemarketblog.com">

不确定为什么标题图像没有正确调整大小。看

我认为我设置正确,但标题图像不会为移动设备调整大小。有什么建议吗

CSS:

HTML:


从HTML中删除宽度和高度。HTML优先于您在CSS中定义的任何内容

编辑:

这是一种液体溶液

HTML

<div id="wrap">
    <div class="container-header-image">
        <a href="http://www.insidemarketblog.com">
        <img id="header-image" src="http://www.insidemarketblog.com/wp-content/uploads/2014/03/logo_header1.png" alt="Inside Market Strategy header image" title="click to return home">
        </a>
    </div>
</div>

从HTML中删除宽度和高度。HTML优先于您在CSS中定义的任何内容

编辑:

这是一种液体溶液

HTML

<div id="wrap">
    <div class="container-header-image">
        <a href="http://www.insidemarketblog.com">
        <img id="header-image" src="http://www.insidemarketblog.com/wp-content/uploads/2014/03/logo_header1.png" alt="Inside Market Strategy header image" title="click to return home">
        </a>
    </div>
</div>

将此代码添加到css.css的底部

@media screen and (max-width:400px) {
    #wrap{
        width: auto;
    }
}

这将在移动设备上将wrap with设置为auto,否则将保持860px。

将此代码添加到css.css的底部

@media screen and (max-width:400px) {
    #wrap{
        width: auto;
    }
}
这将在移动设备上将wrap with设置为auto,否则将保持860px。

添加这些样式

media="screen, projection"
@media (max-width: 450px)
.header {
   padding-right: 0;
   padding-left: 0; 

#wrap {
   width: 100%;
}

.container_header_image {
   width: 100%;
}

#thesis_header_image {
width: 100% !important;
max-width: 400px;
height: auto;
}

}
添加这些样式

media="screen, projection"
@media (max-width: 450px)
.header {
   padding-right: 0;
   padding-left: 0; 

#wrap {
   width: 100%;
}

.container_header_image {
   width: 100%;
}

#thesis_header_image {
width: 100% !important;
max-width: 400px;
height: auto;
}

}

你应该改变容器的宽度。您甚至不需要
媒体
查询

#thesis_header_image {
    height: auto;
    max-width: 100%;
}
.container_header_image {
    width: 100%;
}

请检查,您应该更改容器的宽度。您甚至不需要
媒体
查询

#thesis_header_image {
    height: auto;
    max-width: 100%;
}
.container_header_image {
    width: 100%;
}

请检查

将您的css修改为此

media="screen, projection"
@media screen and (max-width: 400px)
#wrap, .container_header_image {
width: auto;
}

将您的css修改为

media="screen, projection"
@media screen and (max-width: 400px)
#wrap, .container_header_image {
width: auto;
}

我试过了。不起作用。此外,文章中的“SEO”图像也有宽度和高度。你的说法是不正确的。内联样式属性优先于您在CSS中定义的样式。在本例中,指定了宽度和高度属性,这在
img
元素中非常常见。请尝试。不起作用。此外,文章中的“SEO”图像也有宽度和高度。你的说法是不正确的。内联样式属性优先于您在CSS中定义的样式。在本例中,指定了width和height属性,这对于
img
元素非常常见。这是一个不错的解决方案,尽管我会选择400或更大的值。大多数移动设备都有这样的分辨率,而且,标题图像是400px,因此当窗口小于此分辨率时,调整其大小是有意义的。这是一个不错的解决方案,尽管我会选择400或更大的值。大多数移动设备都有这样的分辨率,此外,标题图像是400px,因此在窗口小于此分辨率时立即调整其大小是有意义的。此解决方案唯一的问题是它将图像拉伸到860px的100%,我希望图像最初的宽度为400。我实现了这个更改,您可以看到结果。@user3117275更新了答案。现在检查一下。我把图像放大到了全尺寸。但是恢复了它。这个解决方案唯一的问题是它将图像拉伸到860px的100%,我希望图像最初是400宽度。我实现了这个更改,您可以看到结果。@user3117275更新了答案。现在检查一下。我把图像放大到了全尺寸。但他又恢复了原样。