The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Media queries – Only show specific image is screen width if more than 768px

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #145938

    Hi there,

    Im currently working with media queries, and i want to only load / show specific images if the page width if more than 768px but not much seems to be working. Heres what i have

    `<img src="<?php echo bloginfo( 'template_directory' ) . '/images/logo-.png" width="205" />"  media="(min-width: 769px)">`

    As you can see im working in WordPress thats what the echo statement related to.

    Is this the correct syntax?

    In my CSS file i have the media stream section for this (not sure if this is relevant or not.

    @media only screen and (min-width: 769px) {

    Many thanks.


    Is this a background image?


    I’m not familiar with the format of having a media tag in as an attribute of an IMG (and I’m not sure why you add a dynamic path in front of the image path), but what you’re probably trying to achieve is this?


    ^^ thats exactly it.

    Thanks very much. :-)

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.