Home > Net >  How to fill area under image with text when align applied?
How to fill area under image with text when align applied?

Time:03-25

With Vuejs and Bootstrap v5.0.1 I make image at left and text right aligned and with code :

        <div >
            <div >
                <img  :src="itemDetailsImage.url" >
            </div>
            <div >
                <div v-html="itemDetails.description"></div>
            </div>
        </div>

I have text aligned at right, but I got empty space under image if text is long. How can I fill area under image with text ?

Thanks in advance!

CodePudding user response:

Since you are looking for a floating solution, you don't need the d-flex. Only make the image floating left, not the text.

Not sure what your item_image_left_aligned class does.

<div>
    <div >
        <img  :src="itemDetailsImage.url" />
    </div>
    <div>
        <div v-html="itemDetails.description"></div>
    </div>
</div>

CodePudding user response:

is this what you are looking for. I have added h-100 bootstrap class to the image.

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"/>
<div >
    <div >
        <img  width="100" src="https://dummyimage.com/100x100/000/fff" >
    </div>
    <div >
        <div v-html="itemDetails.description">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

</div>
    </div>
</div>

  • Related