-Salutations, Universe!-
I am currently engaged in a Bootstrap 4 project and I have encountered a hurdle.
Here is the snippet of code that has posed a challenge. Currently, the buttons are positioned right up against the text. My aim is to align them to the right, but only occupy as much space as the longest block of text.
For a visual representation of my objective, please refer to this example:
https://i.sstatic.net/65M8D.png
My initial idea was to enclose them in a div with a class that does not have a fixed size, then align them to the right within it. However, I am uncertain of which class would be suitable for this purpose since the col-x classes do not dynamically expand based on the length of the line. This approach would not be effective as the lines of text can vary greatly in length.
If anyone has any suggestions on how to address this issue or could provide some guidance in the right direction, I would greatly appreciate it.
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<dl class="row">
<dt class="col-2">Key</dt>
<dd class="col-10">Value</dd>
<dt class="col-2">Active</dt>
<dd class="col-10">
<input checked="checked" class="check-box" disabled="disabled" type="checkbox">
</dd>
<dt class="col-2">Values</dt>
<dd class="col-10">
<div class="row">
<div class="col-12">Test <a aria-label="Delete" class="float-right btn-danger btn btn-sm float-none" href="#"><i class="fa-trash fa"></i> </a>
</div>
<div class="col-12">Longer Test <a aria-label="Delete" class="float-right btn-danger btn btn-sm float-none" href="#"><i class="fa-trash fa"></i> </a>
</div>
<div class="col-12">An Even Longer Test <a aria-label="Delete" class="float-right btn-danger btn btn-sm float-none" href="#"><i class="fa-trash fa"></i> </a>
</div>
</div>
</dd>
</dl>