Forums

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

Home Forums CSS Responsive image placement problems

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

    Hi guys,

    I am having some problems controlling the placement of an image when the browser size is altered. You can view the page here: https://reubentesting.persona.co (the image in question is the red “society of the spectacle” on the left.

    I have used the following CSS:

    .imageframe {
            position: absolute;
        width: 100%;
        max-width: 100%;
        float: left;
    }
    
    @media (min-width:800px){
        .imageframe{
            width: 50%;
    }
    }
    
    .centeredimage {
    display: block;
        margin: 40% auto 60% auto;
    }
    

    And corresponding HTML:

    <div class="imageframe">
      <img class="centeredimage" src="https://payload.persona.co/1/2/64321/216467/sots-shadow.png" height="110">
    </div>
    

    Is this code correct? Or is there a better way (and a way which results in more predictable behaviour) to do this?

    Thanks!

    #261749
    Beverleyh
    Participant
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Responsive image placement problems’ is closed to new replies.