V
V
vljs2018-03-16 10:45:38
css
vljs, 2018-03-16 10:45:38

Does browser load background-image if class is not used in html?

Good day.
Passed the test, stumbled upon this issue.
Answer options:
1. Yes
2. No
3. Not always
your ideas?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolai Shabalin, 2018-03-16
@vljs

In this case it is loaded.

<style>
            .image {
                width: 100px;
                height: 100px;
                background-image: url('https://hi-news.ru/wp-content/uploads/2015/01/Galaxy.jpg');
            }
        </style>

        <div class="image"></div>

but in this case, no.
<style>
            .image {
                width: 100px;
                height: 100px;
                background-image: url('https://hi-news.ru/wp-content/uploads/2015/01/Galaxy.jpg');
            }
        </style>

        <div class=""></div>

This is all very easy to check in your browser's developer tools. In the tabnetwork

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question