I'm facing an issue with positioning my button to the right. Despite my best efforts, I haven't been able to move it more than a few positions. In summary, here are the scenarios I've encountered while trying to solve this problem:
When I use the opening tag
, the button appears far on the left side<div className="container">
If I try using just
<div>
or
as the opening tag, the button is completely aligned to the left side<div className="btn-top-right">
The button is positioned on the right side but slightly too far for my liking. (https://i.sstatic.net/7dvJb.png)
Below is the current javascript/html + CSS code I am using:
<div className="container">
<button className="btn btn-primary btn-top-right float-end">CPU</button>
</div>
I have also tried using <div>
and
<div className="btn-top-right">
as the opening tags in the above code snippet.
.btn-top-right {
position: absolute;
top: 20px;
right: 50px;
}
.btn-top-right {
position: absolute;
top: 20px;
right: 50px;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c4a6ababb0b7b0b6a5b484f1eaf7eaf4">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="afcdc0c0dbdcdbddcedfef9a819c819f">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>
<div class="container">
<button class="btn btn-primary btn-top-right float-end">CPU</button>
</div>
Despite setting the 'right' property to 50px as shown above, the button remains unmoved. Any suggestions?