我有以下代码:
.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
但是,引导开关不会与汉堡包和标题文本出现在同一行。为什么引导元素没有出现在新行上,如何确保开关出现在右对齐的同一行上?
By default, the
.form-check
class appears as ablock
, which means that during normal flow it moves to its own line.To create ainlineform check, use the
.form-check-inline
class next to the.form-check
class.Please refer tohttps://getbootstrap.com/docs/5.0/forms /checks-radios/#inline
...