Image Above Post title Won't Resize For Mobile
-
I have used custom fields to add an image above my post titles https://source-pro.org/dark-matter/ and then used the following code in my content.php to place the image.
<div class="imgheader"><img src="<?php echo get_post_meta($post->ID, 'img_header', true);?>" alt="<?php echo get_post_meta($post->ID, 'img_header_alt', true); ?>" width="<?php echo get_post_meta($post->ID, 'width', true); ?>" height="<?php echo get_post_meta($post->ID, 'height', true); ?>" /></div>
Works great in desktop view however it does not resize in mobile views. I experimented with this in my style.css and nothing I add seems to make any difference.
@media screen and (max-width: 400px) { .imgheader { width: 100%; } }
Any idea why I can’t get the image to resize?
Thanks!
- The topic ‘Image Above Post title Won't Resize For Mobile’ is closed to new replies.