0

我有一个标题 div,我想用背景图像完全覆盖它。我希望完全显示图像,所以没有任何东西被裁剪。但是,它似乎正在拉伸图像并对其进行裁剪。

CSS:

..header{

        border-top-left-radius:5px;
        border-top-right-radius: 5px;
        max-width: 600px;
        width:100%;
        height: auto;
        min-height: 200px;
        background: url("img/bg-abstract.jpg") no-repeat fixed;
        background-position: left top;
        background-size: 100%;
        position: relative;
        background-attachment: fixed;
        background-repeat: no-repeat;

    }
4

2 回答 2

0

你需要的是

background-size:cover
于 2014-09-29T15:35:04.700 回答
-1

background-size: cover也尝试使用%而不是px.

于 2014-09-29T16:28:45.343 回答