Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1675

Why does adding an attribute link to my image move my image?

$
0
0

I'm trying to insert two images that are stacked vertically (flex-column) which I can do if both images aren't within an attribute tag. However, when I do put them in a tag, the pictures offset slightly to the right as shown in this image in mobile view.enter image description here

Here, the top image takes you to a link on click, but the bottom doesn't. The HTML I used has this form.

<div className={isWideScreen ? "horizontal-flex basic-container" : "vertical-flex basic-container"}><a href="https://www.website1.com/"><img className="set-pic-size" src={pic1}/></a><img className="set-pic-size" src={pic2}/></div>

The associated css is here for mobile view.

.basic-container {    justify-content: center;}.set-pic-size {    width: 100%;    height: auto;    margin: 10px;    align-self: center;}

Viewing all articles
Browse latest Browse all 1675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>