Forums

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

Home Forums CSS Target image size with @media?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #189515
    John
    Participant

    I want to target image sizes over 250 to be centered when the screen width is below 767px. I could add the attachment ID at the end, but if new images are added, then I’d have to add it in. I’m using WordPress and bootstrap 320 theme.
    I have this so far, which targets all attachments:

    @media (max-width: 767px) {
        div[id*='attachment_'] {
            margin: 0 auto; 
    }
    }
    
    @media (min-width: 768px) {
        div[id*='attachment_'] {
            float: right; 
    } 
    }
    
    #189518
    John
    Participant

    Here’s the site.
    It’s a work in progress.

    Original site is here.

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