G
G
Greg Plitt2018-08-02 07:16:19
css
Greg Plitt, 2018-08-02 07:16:19

Why is the image not responding to CSS changes?

Here is the BW image, on this page https://f8t.ru/trenirovki-rostov/ should have been stretched in the mobile version, but remained reduced as it is.
Code in css:

.single-featured-image-header img {
  
  height: 25%;
  margin: auto;
  width: 25%;
}

@media only screen and (max-device-width: 480px) {
.single-featured-image-header {
width: 100%;
}
}

Can you tell me why the CSS is not working?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Kunitsyn, 2018-08-02
@bit24yes

media only screen and (max-device-width: 480px) {
.single-featured-image-header img {
width: 100%;
height: 100%;
}
}

D
dsmaslov, 2018-08-02
@dsmaslov

It looks like you are setting the rule to the div, not the image.

@media only screen and (max-device-width: 480px) {
    .single-featured-image-header img {
       width: 100%;
    }
}

So everything will be fine, as you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question