S
S
svilkov872015-11-12 17:22:51
css
svilkov87, 2015-11-12 17:22:51

How to make an image responsive if the image is in css?

Good afternoon!
What property should I set in css to make the image adaptive if I load it through css, and not through the index page?

<div class="header">
        <ul class="nav_menu">
            <li><a href="#">Главная</a></li>
            <li><a href="#">О нас</a></li>
            <li><a href="#">Форум</a></li>
        </ul>
</div>

.header{
    width: 100%;
    height: 300px;
    background: url(http://img1.goodfon.su/original/1366x768/e/26/corn-pepper-tomato-vegetables.jpg);
    box-shadow: 0 5px 4px rgba(0,0,0,.5);
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2015-11-12
@svilkov87

background-size: cover;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question