Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

216
Views
How to align buttons with banner bottom right corner with all resolution changes

How to align button with banner top right corner with all resolution changes. I added below code but if we change the resolutions buttons are misaligned to top or bottom of the screen. Could you please help me how to keep the same position(bottom right corner) with all resolutions.

Here is the html code:

.button1 {
    background-color: #e442d0;
    border: none;
    color: white;
    padding: 10px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 7px 12px;
    cursor: pointer;
    font-weight: 500;
    border-radius: 0px;
}

.button2 {
    background-color: #9c50d6;
    border: none;
    color: white;
    padding: 10px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 7px 4px;
    cursor: pointer;
    font-weight: 500;
    border-radius: 0px;
}
.header {
    height: 500px;
}
<html>
   <head>
      <title>Bootstrap Example</title>
      <meta charset="utf-8" />
      <meta name="viewport" content="width=device-width, initial-scale=1" />
      <link
         rel="stylesheet"
         href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
         />
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
      <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
      <style>

      </style>
   </head>
   <body>

      <div>
         <div
            class="col-sm-12 header"
            style="
            background-image: url(https://i.pinimg.com/originals/1b/90/7c/1b907cad177181b12cea64203dcb7623.jpg);
            background-repeat: no-repeat;
            background-size: 100% 100%;
            "
            >
            <div class="row">
               <div class="" style="margin-top: 23%"></div>
               <div class="" style="display: flex; justify-content: flex-end;">
                  <div>
                     <button class="btn btn-primary button1">Button1</button>
                  </div>
                  <div>
                     <button class="btn btn-success button2">Button2</button>
                  </div>
               </div>
            </div>
          </div>
      </div>
   </body>
</html>

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

If you need them at the bottom right corner in all resolutions, absolute positioning will be a better option than making a flex.

Your code becomes:

.button1 {
    background-color: #e442d0;
    border: none;
    color: white;
    padding: 10px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 7px 12px;
    cursor: pointer;
    font-weight: 500;
    border-radius: 0px;
    position: absolute;
    bottom: 16px;
    right: 96px;
}

.button2 {
    background-color: #9c50d6;
    border: none;
    color: white;
    padding: 10px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 7px 4px;
    cursor: pointer;
    font-weight: 500;
    border-radius: 0px;
    position: absolute;
    bottom: 16px;
    right: 16px;
}

.header {
    height: 500px;
    position: relative;
}
<html>
   <head>
      <title>Bootstrap Example</title>
      <meta charset="utf-8" />
      <meta name="viewport" content="width=device-width, initial-scale=1" />
      <link
         rel="stylesheet"
         href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
         />
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
      <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
      <style>

      </style>
   </head>
   <body>
      <div>
         <div
            class="col-sm-12 header"
            style="
            background-image: url(https://i.pinimg.com/originals/1b/90/7c/1b907cad177181b12cea64203dcb7623.jpg);
            background-repeat: no-repeat;
            background-size: 100% 100%;
            "
            >
            <div>
                <button class="btn btn-primary button1">Button1</button>
                <button class="btn btn-success button2">Button2</button>
            </div>
          </div>
      </div>
   </body>
</html>

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!