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
  • #27805
Closed
Open
Issue created Dec 09, 2018 by Administrator@rootContributor

Non-horizontal form-group using fieldset renders legend font-size different than label

Created by: tmorehouse

When using a <fieldset> as the root element of a non-horizontal .form-group (i.e. no .form-row or .row), the <legend> element renders differently than a <label> (specifically the font-size being set to 1.5rem via reboot)

<div class="form-group">
  <label for="input">Label</label>
  <input type="text" class="form-control">
</div>

<fieldset class="form-group">
  <legend>Foobar</legend>
  <div role="group">
    <div class="form-check form-check-inline">
      <input id="check1" class="form-check-input" type="checkbox" name="checks" value="A">
      <label for="check1" class="form-check-label">Radio A</label> 
    </div>
    <div class="form-check form-check-inline">
      <input id="check2" class="form-check-input" type="checkbox" name="checks" value="B">
      <label for="check2" class="form-check-label">Radio B</label> 
    </div>
  </div>
</fieldset>

Renders: image

Manually adding a style font-size: inherit; or font-size: 1rem; to the <legend> appears to fix this issue, but it would be preferential not to have to add the additional styling.

Proposed solution (to mimic <label> default) in /scss/_forms.scss before the .col-form-label rule definition:

.form-group legend {
  font-size: inherit;
}

Which renders the following (using the same above HTML): image

Assignee
Assign to
Time tracking