Issue
The default setting in Bootstrap's _reboot.scss
file is to style the <label>
element as display: inline-block;
, as shown in the screenshot provided.
https://i.sstatic.net/snVl4.png
Resolution
To change the display behavior of the <label>
element to inline
, simply apply the Bootstrap class d-inline
.
Refer to the code snippet below for implementation:
<!doctype html>
<html lang="en>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap demo</title>
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="690b06061d1a1d1b0819295c475a4477">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
</head>
<body>
<div class="form-check fs-3 mb-3">
<input id="low-3" name="low-3" type="radio" value="light">
<label class="d-inline" for="low-3">very long very long very long very long very long very long very long context</label>
</div>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b3d1dcdcc7c0c7c1d2c3f3869d809d80e39ff58c7ef120df6dfb5ld84ec84cfcfe4ab85de8bf0aa08adb19083dcad80cbba96da93dbda95">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-HwwvtgBNo3bZJJLYd8oVXjrBZt8cqVSpeBNS5n7C8IVInixGAoxmnlMuBnhbgrkm" crossorigin="anonymous"></script></body>
</html>