简体   繁体   中英

In Bootstrap, why doesn't my text top align with the adjacent element?

I have a fiddle here:

https://jsfiddle.net/bunhdsyL/

I'm following the documentation here:

https://getbootstrap.com/docs/4.0/utilities/vertical-align/

but my 'Text' label still isn't top aligned with the adjacent textarea element:

在此输入图像描述

How do I top align the text with the textarea ?

Adding the .form-inline class add some things that get in the way of your css, including setting display:flex; and align-items:center on label elements when the screen is larger than the small breakpoint setting.

在此输入图像描述

You can add this css to override that behavior:

.form-inline label {
   align-items: start !important;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM