Placement of buttons in spilt screen interface

As I experiment with bootstrap, I've encountered a challenge that I can't seem to resolve.

I'm aiming to place a 'Login' button at the bottom right of the screen, close to the fold. Below is my current code:

img{

    position: absolute;
    bottom: 40%;
    left: 50%;
    transform:translateX(-40%);
    z-index: 2;
}


.leftside, .rightside {

    height: 50vh;
    width: 100%;

}

@media screen and (min-width:768px)

{
    .leftside, .rightside {
        height: 100vh;
    }
}
.leftside {

    background:#20639B;

}

.rightside {

}
.home-btn {
    position: absolute;
    bottom: 40%;
    left: 50%;
    transform:translateX(-50%);
    z-index: 2;
    font-size: 1.6em;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="homepage.css">
</head>
<body>
    <img src="Bird.png" alt="hummingbird">
    <div class="row no-gutters">
        <div class="col-md-6 no-gutters">
            <div class="leftside">

            </div>



        </div>
        <div class="col-md-6 no-gutters">
            <div class="rightside d-flex justify-content-center align-items-center">
                <h2>Mini Blog Project</h2>
                <button class="btn btn-lg btn-secondary float-right home-btn">Login</button>
            </div>
            

        </div>


    </div>


    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
</body>
</html>

Currently, the button is centered within the right box, which is one option. However, I prefer it to be situated within the right panel, towards the bottom right corner. When I move the button outside of the right div, it shifts correctly but introduces an extra row that disrupts the layout.

Any assistance on this matter would be greatly appreciated.

Answer №1

img{

    position: absolute;
    bottom: 40%;
    left: 50%;
    transform:translateX(-40%);
    z-index: 2;
}


.leftside, .rightside {

    height: 50vh;
    width: 100%;

}

@media screen and (min-width:768px)

{
    .leftside, .rightside {
        height: 100vh;
    }
}
.leftside {

    background:#20639B;

}

.rightside {
 position: relative;
}
.home-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 2;
    font-size: 1.6em;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="homepage.css">
</head>
<body>
    <img src="Bird.png" alt="hummingbird">
    <div class="row no-gutters">
        <div class="col-md-6 no-gutters">
            <div class="leftside">

            </div>



        </div>
        <div class="col-md-6 no-gutters">
            <div class="rightside d-flex justify-content-center align-items-center">
                <h2>Mini Blog Project</h2>
                <button class="btn btn-lg btn-secondary float-right home-btn">Login</button>
            </div>
            

        </div>


    </div>


    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
</body>
</html>

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

What is the best way to create a transparent sticky header that blends with the background while still maintaining visibility over images and text?

On my web page, the background features a radial gradient but the content extends beyond the viewport, causing the center of the gradient to not align with the center of the screen, producing the desired effect. However, I'm facing an issue with a sti ...

Alter the color of the " / " breadcrumb bar

Is there a way to change the color of the slash " / " in breadcrumb trails? I have tried adding CSS styles, but it doesn't seem to work. <ol class="breadcrumb" style="font-size: 20px;"> <li class="breadcrumb-item&q ...

Utilize playing cards as clickable options in Bootstrap 4

I am seeking a creative way to present a boolean selection for users in a card-style format. Despite my efforts, I have not been able to find a suitable solution on StackOverflow. I want to avoid using traditional radio buttons or any generic Bootstrap des ...

Steps to create a basic multi-select dropdown menu with Select2

I have decided to integrate the select2 library into my HTML document because it offers a sleek pillbox style select control that fits well with my design. After carefully following the instructions in the Installation and Getting Started sections of the ...

What steps should I take to fix my responsive media query?

I am currently working on fixing some responsive issues on my WordPress website. Previously, in mobile view, it looked like this: https://i.stack.imgur.com/vpvHy.jpg After adding the following code to the CSS of my child theme: @media only screen a ...

What is the best method to connect a favicon in a Ruby on Rails application?

Here is what I am attempting. <%= image_tag 'favicon.ico', icon="rel" type="image/x-icon" %> ...

What separates $(document).ready() from embedding a script at the end of the body tag?

Can you explain the distinction between running a JavaScript function during jQuery's $(document).ready() and embedding it in the HTML within script tags at the bottom of the body? Appreciate your insights, DLiKS ...

What is the process of creating a download link for a server file in a web browser?

I am attempting to create a straightforward download link for a PDF file that users can upload and then have the option to download. I would like this download feature to appear either in a pop-up box or simply on the Chrome download bar. Despite trying v ...

What is the reason for the presence of white space surrounding the div element

In the td element, I have four nested div elements. However, there seems to be a small margin or space created between them that I cannot figure out how to remove. If this spacing is due to the behavior of the inline-block, then how can I override it? ...

Tips on how to maintain the underline when text is split into two sections

Revised This question is distinct from the duplicate one. I am specifically addressing the issue of ensuring the underline continues until the end of the text, regardless of how many lines it spans. The challenge I am facing is with displaying the underl ...

Tips for Changing the CSS of an External Component with Material-UI-React

Is there a way to override the default CSS of an external component that is not developed in Material-UI or my project? In styled-components, I can simply take the root classes and replace them with my own custom CSS. How can I achieve a similar result wit ...

Clearing a database table in MySql by clicking an HTML button

I have a simple requirement for my website - I need to create a button that, when clicked, will truncate a database table. Unfortunately, I have been unable to do this successfully on my own. Can someone please help me with this task? Here is my attempt a ...

Can someone help me understand how to change the structure in order to identify which class has a body?

I have a small example to share with you: link HTML CODE: <div class="body"> <div class="test">TEST</div> </div> JS CODE: switch (className) { //instead of n, I need to write className case body: alert("my cla ...

Retrieving data from the database by selecting from a dropdown menu

How can I configure the section drop-down list to display all sections available for a specific subject based on the selection made in the previous drop-down menu containing subjects? For instance, if I select subject A, the drop-down should show me all av ...

What is the method for determining the number of unique tags on a webpage using JavaScript?

Does anyone have a method for determining the number of unique tags present on a page? For example, counting html, body, div, td as separate tags would result in a total of 4 unique tags. ...

Is there a way for me to obtain latitude at the upper boundary of mapbox?

provides latitude and longitude based on mouse position, but I am looking for a way to retrieve the coordinates at the northernmost point of the map relative to its center. Is there a built-in method that allows me to access this information? ...

Learn the method for attaching bargraph bars to the bottom without specifying a fixed height

I've been struggling to create a bar graph displaying visitor statistics. The challenge lies in attaching the bars to the bottom without knowing their exact height beforehand. Since my code uses percentages for the height and it fluctuates each time y ...

Gradual transition in and out based on scrolling movements

I am working on a project with HTML/CSS and here is the code I have so far. What I am trying to achieve is a parallax scroll effect where as the user scrolls, the items fade in and out accordingly. For example: If the user has scrolled 200px down, .ite ...

Ways to verify the application of CSS hyphens using Chrome's developer tools

I cannot seem to get automatic hyphens to work via CSS. I have applied the following CSS: body { -moz-hyphens: auto; -ms-hyphens: auto; -o-hyphens: auto; -webkit-hyphens: auto; hyphens: auto; } Despite adding this CSS, my text is not being hyph ...

What is the best way to highlight a button once it has been activated?

Here is an HTML button: <button autofocus role="button" ng-disabled="something.$invalid">{{ Continue }}</button> The button starts off disabled, so the autofocus attribute doesn't work. My goal is to have focus on the button as soon as i ...