Within my design, I placed a radio button in two cards and grouped them together by nesting the cards inside a btn-group. While this setup functions well, it encounters layout issues on small display sizes. Specifically, when the screen shrinks to xs size, the two columns should occupy an entire row but instead, the second card disappears without being scrollable. Despite numerous attempts, I have been unable to resolve this issue for small screens. When I remove the radio group wrapper, the layout works properly but unfortunately, the functionality of my radio buttons is lost.
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col">
<!-- Grid row -->
<div class="row">
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<div class="col-12 col-lg-6 col-md-6">
<div class="card">
<div class="card-body">
<h5 class="mb-4">Card Title 1</h5>
<div class="d-flex justify-content-center">
<div class="card-circle d-flex justify-content-center align-items-center">
<i class="fa fa-users light-blue-text"></i>
</div>
</div>
<p class="grey-text">Paragraph 1.</p>
<label id="label1" class="btn btn-secondary active" for="input1">
Radio1
<input type="radio" id="input1"
name="name1"
value="val1" checked>
</label>
</div>
</div>
</div>
<div class="col-12 col-lg-6 col-md-6 mb-lg-0 mb-4">
<div class="card">
<div class="card-body">
<h5 class="mb-4">Card title 2</h5>
<div class="d-flex justify-content-center">
<div class="card-circle d-flex justify-content-center align-items-center">
<i class="fa fa-user light-blue-text"></i>
</div>
</div>
<p class="grey-text">Card paragraph 2.</p>
<label id="label2" class="btn btn-secondary" for="radio2">
<input type="radio" id="radio2"
name="name1"
value="val2">
Radio 2</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Although not functioning, the layout remains intact:
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col">
<!-- Grid row -->
<div class="row">
<div class="col-12 col-lg-6 col-md-6">
<div class="card">
<div class="card-body">
<h5 class="mb-4">Card Title 1</h5>
<div class="d-flex justify-content-center">
<div class="card-circle d-flex justify-content-center align-items-center">
<i class="fa fa-users light-blue-text"></i>
</div>
</div>
<p class="grey-text">Paragraph 1.</p>
<label id="label1" class="btn btn-secondary active" for="newSurgery">
Radio1
<input type="radio" id="input1"
name="name2"
value="val1" checked>
</label>
</div>
</div>
</div>
<div class="col-12 col-lg-6 col-md-6 mb-lg-0 mb-4">
<div class="card">
<div class="card-body">
<h5 class="mb-4">Card title 2</h5>
<div class="d-flex justify-content-center">
<div class="card-circle d-flex justify-content-center align-items-center">
<i class="fa fa-user light-blue-text"></i>
</div>
</div>
<p class="grey-text">Card paragraph 2.</p>
<label id="label2" class="btn btn-secondary" for="radio2">
<input type="radio" id="radio2"
name="name2"
value="val2">
Radio 2</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>