打印CSS最大宽度不适用于chrome,opera,即

时间:2015-11-11 13:01:22

标签: html css

我有这个产品页面,用户可以打印;它有一个图像,其容器有一个max-width属性,firefox正确解释,但其他浏览器没有。

我甚至尝试删除缓存。

相关HTML:

<div id="img_producto" class="span4 slider_area">
    <div class="view view-first">
        <img alt="" src="images/gallery/2.jpg">
    </div>
</div>

相关CSS:

.span4 {
    width: 370px;
}

.view {
    background: #f1f1f1 url("../img/spinner.gif") no-repeat scroll center center !important;
    cursor: default;
    float: left;
    overflow: hidden;
    position: relative;
    text-align: center;
    width: 100%;
}

.view-first img {
    transition: all 0.2s linear 0s;
}

img {
    border: 0 none;
    height: auto;
    max-width: 100%;
    vertical-align: 10%;
}

打印CSS:

.top_line, .page_head, .blog_sidebar, .blog_item_description, #ficha_tecnica hr, .footer, .bottom_line {
    display: none; // Hide irrelevant stuff
}

#ficha_tecnica p {
    margin-bottom: 2px !important;
}

img {
    max-width: 50% !important; // ff displays correctly even without this
}

FF预览(正确): enter image description here

chrome预览: enter image description here

0 个答案:

没有答案