Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
256 views
in Technique[技术] by (71.8m points)

I have tried everything. Bootstrap 5 + Bootstrap Icons. In a <p> tag, I cannot get the icons vertical aligned to the text

I am trying to do something really simple.

I have a some text and a bootstrap icon wrapped in a <p> tag.

I cannot manage to vertical align the icon to the text. The icon always displays lower than the text.

I have searched everywhere and tried all the solutions proposed for similar cases, but nothing works.

The code I am using is exactly the same that bootstrap icons use to showcase their icons here.

You can see from my screenshot what the problem is:

Icon is not aligned

The icon is not vertical aligned to the text.

Here is how it should look like: enter image description here

The weird thing is that if I set vertical-align: 1px; to the icon itself, the problem seems to be fixed. But this should not be the solution and this should work with bootstrap out of the box.

What am I doing wrong?

Here is my code:

<div class="d-flex justify-content-between">
   <p class="small">
      Combined data
   </p>
   <p class="small">Refresh data <i class="bi bi-linkedin"></i></p>
</div>

Thanks for your help.

question from:https://stackoverflow.com/questions/65857531/i-have-tried-everything-bootstrap-5-bootstrap-icons-in-a-p-tag-i-cannot-g

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...