I have a parent div that accommodates an image and a p element. I can't change the dimension of the image and the div width can't exceed the image width, so i make the image a block element. But after that i have a long text inside p element, and it makes p element 's width exceed its parent div width. How can make the p element 's width the same as its parents div and its sibling image.
<div>
<img src="some-url">
<p>some-really-long-text</p>
</div>
img {
display: block;
}