Move the Login button to the bottom of my web application

Is there a way to position my Login button at the bottom center of the screen with an image displayed over it? This setup is intended for the homepage, but I'm having trouble getting the image to display.

Here's the code snippet:

<div class="container-fluid">
  <img alt="Sportly logo" src="~@/assets/sportly.png">
    <div class="row">
        <div class="col-md-12">
            <h3>Login</h3>
            <button class="btn btn-primary"
                @click="signIn">

               <i class="fa fa-twitter"></i>
                    Sign In with Twitter
                </button>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    methods: {
        signIn () {
            this.$store.dispatch('signIn')
        }
    }
}
</script>

<style scoped>
h3 {
    font-weight: 700;

}
button {
    background-color: #1dcaff;
    border: 1px solid  #1dcaff;


}
div button:hover {
    background-color: #00aced;
    border: 1px solid  #00aced;

}
</style>

https://i.sstatic.net/Oj7cZ.png

Answer №1

To place the sign-in button on top of an image, you can create a div with a background image and then position the button on top of it. It seems like your question implies that the image should cover the button, but I assume that's not your intention.

Here is the CSS:

.mybackground {
    background-image: url('yourimage.jpg');
}

And here is the modified HTML (remove img tag):

<div class="container-fluid mybackground">
    <div class="row">
        <div class="col-md-12">
            <h3>Login</h3>
            <button class="btn btn-primary"
                @click="signIn">

               <i class="fa fa-twitter"></i>
                    Sign In with Twitter
                </button>
            </div>
        </div>
    </div>

Answer №2

I utilized a combination of CSS properties to achieve the desired layout: I employed position: fixed with bottom: XXpx to anchor the div at the bottom of the page, used width: 100% along with margin: 0 auto and text-align: center for centering the elements, and included position: relative and z-index: 1 to position the login button and image on top of each other. Here are the outcomes:

h3 {
  font-weight: 700;
}
button {
  background-color: #1dcaff;
  border: 1px solid  #1dcaff;
}
div button:hover {
  background-color: #00aced;
  border: 1px solid  #00aced;
}
.loginarea {
  position: fixed;
  bottom: 20px; /* Distance from window bottom */
  width: 100%;
}
.loginarea .center {
  margin: 0 auto;
  width: 200px; /* Width of logo */
}
.loginarea .logo {
  position: relative;
  display: block;
}
.loginarea .row {
  position: absolute;
  text-align: center;
  width: 200px; /* Width of logo */
  z-index: 1;
}
<div class="container-fluid loginarea">
  <div class="center">
    <div class="row">
      <div class="col-md-12 logindiv">
        <h3>Login</h3>
        <button class="btn btn-primary"
          @click="signIn">
          <i class="fa fa-twitter"></i>
          Sign In with Twitter
        </button>
      </div>
    </div>
    <img class="logo" alt="Sportly logo" src="http://placekitten.com/200/100">
  </div>
</div>

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

Select an item from the options available

Looking to automatically select a specific item from a combobox upon clicking a button on my webpage. The page includes both PHP and JavaScript code for this functionality. Currently, I have a JavaScript function triggered by the "onclick" event of the bu ...

WordPress WooCommerce causing the right bar to be pushed below

I'm currently facing an issue on my WordPress site with a purchased template and Woocommerce integration. The problem lies in the fact that the right sidebar gets pushed down on the shop page. When I reached out to the template developers, they sugges ...

Debug messages are not displaying in ExpressJS

I'm currently working with ExpressJS and I want to show internal debug messages, similar to what's described here at https://expressjs.com/en/guide/debugging.html. When I attempt to run the following command in VS Code (Windows Powershell): "`se ...

`Laravel 8 integration with Laravel-dompdf through API`

Can a PDF file be generated from a controller to a Vue.js component using an API route? public function usersPrintPdf() { $data = [ 'title' => 'First PDF for Medium', 'heading' => &apo ...

Creating a display of divs that flow from left to right in each row, and then stacking the rows from bottom to top using CSS and jQuery

My current dilemma involves a collection of divs that must be displayed in a specific order, but with a rather intricate layout. Essentially, this is the structure of my HTML: <div> <div class="box">1 (first in list)</div> <di ...

The chosenValues.filter method hit an unexpected token; a comma was anticipated

I have encountered a syntax error in the following line: queryComponents: prevState.seletedValues.filter((a, i) => (i !== index)); I am attempting to swap out splice with filter. I've attempted modifying brackets, both adding and removing them, b ...

Issues with the Bootstrap date time picker functionality

Even though I have added all the necessary libraries for the date time picker, it still isn't working properly. You can check out this fiddle to see the code. <div class='input-group date' id='from_time'> <input type ...

Issues with the Lengthmenu option in Bootstrap Datatables Javascript

I'm currently facing an issue with my bootstrap datatables searchable table. Everything is working fine, except for the fact that users are unable to choose how many rows they want to see per page. The default setting of 10 results per page is not suf ...

When attempting to capture an element screenshot as PNG, a TypeError occurs indicating that the 'bytes' object is not callable

Can someone please help me figure out how to save a screenshot of a specific element in Selenium using Python3? Here is the code I am trying: from selenium import webdriver import pyautogui as pog import time options = webdriver.ChromeOptions() options ...

What would be the ideal technology stack (modules, frameworks) to use for delving into node.js and creating a successful first project that allows for learning and growth?

A year ago, I took my first small steps into the world of Node.js. Back then, I was overwhelmed by the sheer number of modules and frameworks available. Now, I am determined to dive deeper into the Node environment and kickstart a web-based project that wi ...

What is the process for receiving notifications from Stack Overflow for new questions?

Interested in responding to the latest questions on JavaScript, React, React Native and Node.js. How can I stay updated on new user queries related to these topics? ...

Center button vertically in the navigation bar

I'm working on a website utilizing the Twitter-Boostrap framework and I want to position a navbar-toggle button on the right side of the navigation bar, perfectly centered. Is there a way to achieve this? This is what I have attempted so far: https ...

Troubleshooting Media Queries in HTML, CSS, Bootstrap: Why Aren't They Applying as Expected?

I am still fairly new to web programming and just starting out with bootstrap. After creating a section of my page that worked well on larger screens, I realized it wasn't responsive enough on smaller devices. The height was set at 400px, causing hor ...

What is the best way to display multiple HTML files using node.js?

click here to see the image Here is my server.js file. Using express, I have successfully rendered the list.html and css files on my server. However, I am encountering an issue when trying to navigate from list.html to other html files by entering localho ...

How to save an image in Internet Explorer browser without opening it automatically

Is there a way to download an image in Internet Explorer using the <a> tag without it opening in a new tab? Since IE does not support the HTML5 <download> tag, I am looking for a solution to directly download the image instead of opening it. ...

Steps for creating a universal HTML script path using a reverse proxy

When developing web applications using Node.js with Express and running them on a cloud server, each application typically listens on its own unique port. However, it is not ideal to have the port number visible in the URL. To address this issue, I utiliz ...

Display the JSON data in an organized HTML table

I am struggling to display a JSON response in an HTML formatted table. It is showing as unidentified. Here is the JSON response I am working with: { "status": "200", "success": true, "mesg": "Data Found", "refNo": "10101010", "benefici ...

Using CSS and Bootstrap together in the Yii2 framework

Hey there, I'm new to Yii2 and recently put together a layout page. However, I seem to be having some trouble with my CSS - it's not fully loading, only parts of it are displaying correctly. Is there anyone out there who can lend a hand? This is ...

Can a guild ID be stored in a Discord set?

Having an issue storing guild IDs in my bot. I tried using Set(), but when the bot goes offline, all IDs are removed from the set and I have to continually add them again. Is there a solution for this problem? Here is what I attempted: const collection = ...

Leverage socket.io within my controller using yeoman

Recently, I have installed yo angular-fullstack If you want to check out the source code of this project, you can find it here: https://github.com/DaftMonk/fullstack-demo Here's a glimpse of my API structure: thing ├── index.js ...