I have this problem that I can't solve. Basically, I want to do this: my problem
This is a screenshot of me putting the <img>
into the p
tags, but I am not happy with that solution. For example - What if I don't know the number of lines in my paragraph and I still want to centre the image ...
I tried solving this in css:
.container {display:flex; justify-content:flex-end}
.item {align-self: center}
This doesn't work because the container is also affecting the p element ... So why don't I just put the img into another div? Well, this doesn't work either...
.img_container {display: flex; justify-content:flex-end; width:100%;}
.item {align-self: center;}
This doesn't work, because of the width of the img_container is affecting the p also and If I don't make the width:100%;
than the div is useless and the img will not be at the right side as I wanted it to be ...
I found a lot of "wrapping text around an image" questions and answers that are pointed me to css align property, but I am using html5 and this does not work for me.
I also want to point out that I am not from an English speaking country so searching for topics is hard for me if I don't know the exact name of the topic. So if there is an entire thing based around this topic than please point me into direction of it and I will be happy to read it.
SOLUTION: I solved it with the shape-outside thing, but rather than calculating background I just added an img tag to the div ... it ended like this
img {position: absolute; top:100px;}