1

So I'm having a mental block as to why the image is not decreasing when the screen decreases in size. I'm creating a signature block, and I want the image to decrease / be responsive, so the entire wrapper will not stack to two columns; I'd like it to be just one.

I know making the image have a max-width 100% and an auto height should make it responsive, but it's not making it such. I thought giving a width to the wrapper and the div parenting it would do, but it hasn't.

    .wrapper {
        max-width: 100%;
        height: auto;
    }

    .leftSide {
        float: left;
        padding: 20px 0;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    img,
    .rightSide {
        margin: 20px;
    }

    .rightSide {
        display: inline-block;
        font-size: initial;
    }

<div class="wrapper">
    <div class="leftSide">
        <img src="https://dummyimage.com/200x150/000/fff" alt="">
    </div>`enter code here`
    <div class="rightSide">
        <p><span>First Last</span>&nbsp;Company Title</p>
        <hr>
        <p><span>P</span>&nbsp;<a href="tel:">&#40;123&#41;456-7890</a>&nbsp;&nbsp;&nbsp;<span>E</span>&nbsp;<a href="mailto:">123&#64;abccompany.com</a></p>
        <p><span>URL</span>&nbsp;<a href="" target="_blank">www.company.com</a></p>
    </div>
</div>

Codepen view here

I'd like for it to scale down the image as the screen sizes decreases so the signature / body / sides doesn't have to stack. Please assist if possible. Thanks!

1 Answers1

0

try using view-port units instead of percent. here's a reference, take a look: https://www.w3schools.com/cssref/css_units.asp

EshgheCode
  • 288
  • 4
  • 19