Вопрос по css3, css – Предлагает ли CSS3 свойство «минимального размера» для «фона»?

19

Error: User Rate Limit Exceeded

background-size: 100%;

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

<div id="bg">
    <img src="images/bg.jpg" alt="">
</div>

#bg {
    position:fixed;
    top:-50%;
    left:-50%;
    width:200%;
    height:200%;
}
#bg img {
    position:absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
    margin:auto;
    min-width:50%;
    min-height:50%;
}
Error: User Rate Limit Exceeded BoltClock♦
Error: User Rate Limit Exceeded francisMi

Ваш Ответ

2   ответа
29

Error: User Rate Limit Exceeded

background-size: contain;

Error: User Rate Limit Exceeded

background-size: cover;

Error: User Rate Limit ExceededcoverError: User Rate Limit ExceededcontainError: User Rate Limit Exceeded

Error: User Rate Limit ExceededError: User Rate Limit Exceeded.

Error: User Rate Limit ExceededcontainError: User Rate Limit Exceeded
Error: User Rate Limit Exceededbody, html { background: url('files/background3.jpg') center 0 fixed; background-color: #000; font-family: Verdana, Geneva, sans-serif; font-size: 14px; line-height: 1.3; background-size: contain; } francisMi
3

@media screen and (max-width:700px){
    #bg img { width: 500px; /* fixed width under 700px */ }
}

Похожие вопросы