How to right-align images using Bootstrap Vue
P粉216807924
P粉216807924 2023-09-07 23:33:56
0
1
554

I'm new to Bootstrap Vue and trying to align an image to the right using the b-card header. I tried using <span> or <div>. The template's title size was perfect until I added the image, which also showed up a little to the right, but also a little below. Here is my codepen link. Any help you can provide would be greatly appreciated.

https://codepen.io/tone373/pen/JjeYazG

<b-card header-tag="header">
  
  <template #header>
    <h4>b-img</h4>
    <b-img right src="https://picsum.photos/125/125/?image=58" alt="Right image"></b-img>
  </template>

</b-card>
P粉216807924
P粉216807924

reply all(1)
P粉786800174

You can use Bootstrap’s grid system:

<b-card header-tag="header">
  <template #header>
    <b-row align-h="between" class="align-items-center">
      <h4 class="mb-0">b-img</h4>
      <b-col cols="auto">
        <b-img right src="https://picsum.photos/125/125/?image=58" alt="Right image"></b-img>
      </b-col>
    </b-row>
  </template>
</b-card>

b-rowUse align-h="between" to align elements horizontally and leave space between them. <h4> and pictures are placed in columns 1 and 2, cols="auto" in b-col will automatically adjust the width .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!