Tips for relocating several buttons to the upper right corner

I have a dilemma with the positioning of 10 buttons on my webpage. Specifically, I would like to place them in the top right corner, but they are currently at the bottom. Can you assist me with moving the buttons?

My desired outcome can be seen here.

I suspect that I need to utilize display:flex. Any thoughts?

If you have any suggestions, please share them with me. Below is the code I am working with.

Thank you in advance for your support and time.

<!DOCTYPE html>
<html>
   <head>
      <title>HTML CSS JS</title>
   </head>
   <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
   <body>
      <div class="home-content container">
         <h1 class="text-center pt-5 pb-3">Signalétique</h1>
         <div class="row pt-3 container">
            <div class="card" style="width: 100%;">
               <div class="card-body">
                  <table class="table table-hover table-striped" style="width: 60%">
                     <tbody>
                        <tr>
                           <th>Ticker</th>
                           <td>SOLB</td>
                        </tr>
                        <tr>
                           <th>Code SVM</th>
                           <td>347075</td>
                        </tr>
                        <tr>
                           <th>Code ISIN</th>
                           <td>BE00003470755</td>
                        </tr>
                        <tr>
                           <th>Genre</th>
                           <td>Actions</td>
                        </tr>
                        <tr>
                           <th>Pays d'origine</th>
                           <td>Belgique</td>
                        </tr>
                        <tr>
                           <th>Secteur économique</th>
                           <td>Matériaux</td>
                        </tr>
                        <tr>
                           <th>Devise de cotation</th>
                           <td>EUR</td>
                        </tr>
                        <tr>
                           <th>Groupe de cotation</th>
                           <td>(AO)</td>
                        </tr>
                        <tr>
                           <th>Unité de cotation</th>
                           <td>1,0000000</td>
                        </tr>
                        <tr>
                           <th>Site Internet</th>
                           <td>www.solvay.com</td>
                        </tr>
                     </tbody>
                  </table>
                  <div class="btn-group-vertical">
                     <button type="button" class="btn btn-primary mb-2 ">Best Execution</button>
                     <button type="button" class="btn btn-primary mb-2">Etat du marché</button>
                     <button type="button" class="btn btn-primary mb-2">Graphiques Historiques</button>
                     <button type="button" class="btn btn-primary mb-2">Historique des cours</button>
                     <button type="button" class="btn btn-primary mb-2">Ordre</button>
                  </div>
                  <div class="btn-group-vertical">
                     <button type="button" class="btn btn-primary mb-2 ms-2">Best Execution</button>
                     <button type="button" class="btn btn-primary mb-2 ms-2">Etat du marché</button>
                     <button type="button" class="btn btn-primary mb-2 ms-2">Graphiques Historiques</button>
                     <button type="button" class="btn btn-primary mb-2 ms-2">Historique des cours</button>
                     <button type="button" class="btn btn-primary mb-2 ms-2">Ordre</button>
                  </div>
               </div>
            </div>
         </div>
      </div>
   </body>
</html>

Answer №1

Some slight modifications may be necessary to adjust the columns, but below is a proposed solution:

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" />

<body>
  <div class="home-content container">
    <h1 class="text-center pt-5 pb-3">Signalétique</h1>
    <div class="row pt-3 container">
      <div class="card" style="width: 100%;">
        <div class="card-body">
          <div class="row">
            <div class="col">
              <table class="table table-hover table-striped" style="width: 60%;">
                <tbody>
                  <tr>
                    <th>Ticker</th>
                    <td>SOLB</td>
                  </tr>
                  <tr>
                    <th>Code SVM</th>
                    <td>347075</td>
                  </tr>
                  <tr>
                    <th>Code ISIN</th>
                    <td>BE00003470755</td>
                  </tr>
                  <tr>
                    <th>Genre</th>
                    <td>Actions</td>
                  </tr>
                  <tr>
                    <th>Pays d'origine</th>
                    <td>Belgique</td>
                  </tr>
                  <tr>
                    <th>Secteur économique</th>
                    <td>Matériaux</td>
                  </tr>
                  <tr>
                    <th>Devise de cotation</th>
                    <td>EUR</td>
                  </tr>
                  <tr>
                    <th>Groupe de cotation</th>
                    <td>(AO)</td>
                  </tr>
                  <tr>
                    <th>Unité de cotation</th>
                    <td>1,0000000</td>
                  </tr>
                  <tr>
                    <th>Site Internet</th>
                    <td>www.solvay.com</td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="col">
              <div class="btn-group-vertical">
                <button type="button" class="btn btn-primary mb-2">
                    Best Execution
                  </button>
                <button type="button" class="btn btn-primary mb-2">
                    Market State
                  </button>
                <button type="button" class="btn btn-primary mb-2">
                    Historical Charts
                  </button>
                <button type="button" class="btn btn-primary mb-2">
                    Price History
                  </button>
                <button type="button" class="btn btn-primary mb-2">
                    Order
                  </button>
              </div>
              <div class="btn-group-vertical">
                <button type="button" class="btn btn-primary mb-2 ms-2">
                    Best Execution
                  </button>
                <button type="button" class="btn btn-primary mb-2 ms-2">
                    Market State
                  </button>
                <button type="button" class="btn btn-primary mb-2 ms-2">
                    Historical Charts
                  </button>
                <button type="button" class="btn btn-primary mb-2 ms-2">
                    Price History
                  </button>
                <button type="button" class="btn btn-primary mb-2 ms-2">
                    Order
                  </button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>

Answer №2

Consider utilizing the power of flexbox 👍🏼 Start by creating a main container, setting it to display as flex, and applying some container and item properties to achieve the desired layout. Set display to: flex Then continue...

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

"Creating Eye-Catching CSS Animation Effects with Dynamic Initial States

I am looking to understand how I can seamlessly transition from a hover-triggered animation to an exit-hover animation, regardless of where the hover animation is in progress. Currently, if I exit hover too quickly, the animation jumps back to its starting ...

Limiting the scrolling capability within a flex container by using the nowrap

When using flex with nowrap, it appears that the horizontal scroll bar only allows moving to the right while the items on the left remain hidden. To demonstrate this issue, I have created a sample on CodePen: http://codepen.io/anon/pen/QpgvoZ This behavio ...

How come the picture extends beyond the borders of its parent container when I expand the width?

Despite my efforts, I haven't been able to figure this out successfully. My goal is to align the text elements next to the image just like in the example picture below. Initially, I achieved this using absolute positioning. absolute positioning Howe ...

Create engaging text animation by transitioning from horizontally displayed text to vertically displayed text with the letters standing upright using An

I'm trying to create an animation where an acronym is displayed horizontally in the middle of the screen and then flips vertically. The challenge I'm facing is rotating individual letters once they are vertical so that the text reads from top to ...

Having trouble setting the background of a div in CSS

How can I apply the background-color: #f8f8f8 class to the step class without interfering with the display of the horizontal lines after 1, 2? What could be causing this issue? .main-progress { text-align: center; position: relative; margin- ...

The persistent underline on the tooltip just won't go away

Hey there, this is my first time posting a question here so I hope I got everything right! I'm currently in the process of creating a form for a WordPress site using Bootstrap. I need to incorporate tooltips with Font Awesome icons, but for some reas ...

Make an element in jQuery draggable but always within the viewport

My issue is that when I resize the window, the element stays in its position until I start dragging it. Once I drag it and then resize the window again, it doesn't stay within its container. To better illustrate my problem, you can view a demo on Fid ...

Guide on creating a stationary side navigation bar in HTML with Bootstrap 5 and CSS

I am developing a website with a fixed side navigation bar that stays in place when scrolling through the content section. I experimented with both the fix-position in Bootstrap 5 and CSS methods, but no matter how I set it up, the side bar remains transpa ...

The CSS Image Gallery refuses to be centered

.imageContainer{ width: 100%; margin: 0 auto; position: relative; text-align: center; } .imageContainer img{ width: 250px; height: 250px; float: left; } .imageContainer img:hover{ opacity: 0.60; } I am having trouble gett ...

How are the plugins configured for `postcss-import` implemented?

Recently, I've transitioned to using PostCSS exclusively with Webpack. As I explore the functionalities of using postcss-import to inline external stylesheets, I'm noticing that its options offer the ability to configure plugins and transformers ...

Responsive div that reacts to scrolling

I am looking for a div that can dynamically change its position as I scroll up or down the page. For example, it could start 30px from the top but then move to 100px as I scroll down further. This div will be located on the right-hand side of my page, clo ...

Discrepancy detected in AGM Map printout

When attempting to print my Angular AGM Map from Chrome, I noticed a large grey gap in the map. This gap is visible even when "background graphics" are turned off and it causes the map image below it to shift downwards. If you want to reproduce this issue ...

What could be causing the issue of not being able to load CSS files or images?

I'm currently in the process of learning how to develop websites, but I've encountered a stumbling block that I can't seem to overcome. I'm hoping someone here can help me out. I'm facing an issue where I am unable to link either a ...

Arrange components within the form

Just started experimenting with this a few days ago. In my form, there is a text field and a button that I want to align side by side at the center of the form. .row { width: 100%; margin-bottom: 20px; display: flex; flex-wrap: wrap; } .col-6 { ...

Structured chat interface with unchanging top and bottom sections

I'm currently trying to come up with a way to structure my chatbox so that it has a fixed header at the top and a fixed footer at the bottom, while allowing the chatbox body to scroll within those constraints. I've experimented with various appro ...

"Implementing CSS inline styles for improved appearance on a Safari browser when visiting

Having some trouble using CSS to create rounded corners on my Facebook fan page. Everything works fine except for Safari browser. I've tried inline styles and a separate stylesheet, but no luck. Any help would be appreciated. My CSS for rounded corne ...

The percentage height setting for a div is not functioning properly, but setting the height in pixels or viewport

Within a dialog box body, I am attempting to display a table and have applied a CSS class to the wrapping div. When specifying the height in pixels or viewport height units, it works as expected. However, when using a percentage like 50%, the height of the ...

Tips for accessing information from a FOR loop within DIV tags

Let's explore the following code snippet: Here is the HTML generated: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Website ...

Displaying truncated title text

Would it be feasible to display clipped text (overflow: hidden) in a way that is fully readable when hovered over? An attempt like this: div:hover { overflow: visible; background-color: yellow; } results in the text overlapping, making it impossible ...

Click on another part of the page to reveal a dropdown menu

I am seeking a way to trigger the opening of this dropdown select not by directly clicking on its position, but rather by clicking on another <span>. Displayed below is the dropdown menu: <div class="styled-select"> <span id="camDurati ...