Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #18703
Closed
Open
Issue created Dec 27, 2015 by Administrator@rootContributor

Vertical spacing for form with both p.text-help and p.text-muted is broken

Created by: tordans

A form layout we use very regularly is an input with a help-text below which also can have an error message.

Right now, the error case looks like this: bildschirmfoto 2015-12-27 um 14 32 18

IMO the spacing is broken, it should look like this: bildschirmfoto 2015-12-27 um 14 32 25

The generated html for this case is:

<div class="form-group string required registration_name has-danger">
  <label class="string required sr-only form-control-label" for="registration_name">Name</label>
  <input class="string required form-control-lg form-control" placeholder="Name" type="text" value="" name="registration[name]" id="registration_name">
  <p class="text-help">can't be blank</p>
  <p class="text-muted">Lorem</p>
</div>

A possible css fix might be something like this:

p.text-help ~ p.text-muted {
  margin-top: -16px;
}

Note: I cannot just add a .m-b-0 in this case since the html is generated by simple_form which has no way of distinguishing those cases.

Questions:

  • Is there a "proper" way to write this kind of form? What would be a better alternative to the P-Tags that uses the default-font-sizing but not the P-Tag-Margins?
  • Is this a usage that should be fixed in Bootstrap4 with specific css or should I work around it in my custom css?
Assignee
Assign to
Time tracking