Why don't Bootstrap switches appear on the same line as other elements in a div?
P粉221046425
P粉221046425 2023-09-02 17:46:52
0
1
501

我有以下代码:

.global-wrap { display: flex; flex-direction: row; align-items: center; justify-content: center; } .header { width: 1024px; background-color: purple; padding: 7px; margin: 0; } div { overflow: hidden; white-space: nowrap; } .contents svg { height: 25px; width: 25px; vertical-align: middle; } .contents .title { color: white; margin: 0; font-size: 16px; vertical-align: middle; margin-left: 15px; } .contents .switch { align-content: right; }
  
Title

但是,引导开关不会与汉堡包和标题文本出现在同一行。为什么引导元素没有出现在新行上,如何确保开关出现在右对齐的同一行上?

P粉221046425
P粉221046425

reply all (1)
P粉129731808

By default, the.form-checkclass appears as ablock, which means that during normal flow it moves to its own line.

To create ainlineform check, use the.form-check-inlineclass next to the.form-checkclass.

Please refer tohttps://getbootstrap.com/docs/5.0/forms /checks-radios/#inline

 ... 
    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!