What is the best way to create a pair of equal-sized buttons in a single row?

After attempting to follow this reference How to make two buttons the same size?

Unfortunately, that solution didn't work for my specific case.

Currently using bootstrap 4, I am facing an issue where I need to ensure that two buttons in a row are of the same size. How can I resolve this?https://i.sstatic.net/kz3GU.png

Below is the snippet from my code:

<style>

  .form-style-5{
    max-width: 500px;
    padding: 10px 20px;
    margin-top:2em;
    margin: 10px auto;
    margin-bottom: 1em;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 8px;
    font-family: Georgia, "Times New Roman", Times, serif;
  }

  .container{
    margin-bottom: 2em;
  }

  .col-sm-6{
    width:120px;
    height:50px;
    text-align:center;
    line-height:1.1em;
    font-size:1.1em;
  }
  </style>
<body style="background-color: #040b5a">
    <div class="container" style="padding:50px">
    <form class="form-style-5" method="post">
      <h1 style="font-family:verdana">Login</h1>
        {% csrf_token %}
        <table>
        {{form | crispy}}
        <button class="btn btn-primary btn-block fa-lg gradient-custom-2 mb-3" type="submit" style="background-color: #040b5a; border: 0px">Login</button>
    </form>
    <hr>
    <div class= "row">
      <div class="col-sm-6"><a href="/signup" class="btn btn-primary btn-block fa-lg gradient-custom-2 mb-3" style="background-color: #040b5a; border: 0px"> Customer Sign-up</a></div>
      <div clas="col-sm-6"><a href="/seller_signup" class="btn btn-primary btn-block fa-lg gradient-custom-2 mb-3" style="background-color: #040b5a; border: 0px">Seller Sign-up</a></div>
    </div>
  </table>
</div>
</body>
</html>

Answer №1

The code is in need of an "s" for the class attribute on line 40

<div class="col-sm-6"><a href="/seller_signup" class="btn btn-primary btn-block fa-lg gradient-custom-2 mb-3" style="background-color: #040b5a; border: 0px">Seller Sign-up</a></div>

Answer №2

<div class= "row">
  <div class="col-sm-6"><a class="btn-primary"> Join as a Customer</a></div>
<div class="col-sm-6"><a class="btn-secondary">Join as a Seller</a></div>
</div>

 .btn-primary, .btn-secondary{
width: 100%;
text-align:center;
background: #040b5a;
color:#fff !important;

}

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

Accessing and manipulating web elements using either XPath or CSS selectors

Having trouble selecting a specific piece of information using xpath or css selector. Error messages keep appearing. Can someone help identify the issue? This snippet is from my code: output = driver.find_element_by_xpath("//td[@class_= 'sku']" ...

I wish to substitute a form field with a different one once the value of another field matches a specific condition

The issue I'm facing is that the field disappears once "US" is chosen and does not revert back to the options when another choice is made. teacher_signup.html {% block content %} <h2>Sign Up As Teacher</h2> <form method="post> ...

The AudioContext feature is functioning properly on Google Chrome but experiencing issues on Safari

In Safari, I understand that audio context needs to be created after user interaction. Despite this knowledge, the code below still didn't produce the desired result. HTML <button onclick="play">Play</button> Javascript functio ...

Automate website button clicks using Python and Selenium

I could really use some assistance: Currently, I have a Python/Selenium code snippet that carries out basic actions on a website to retrieve names, and it works perfectly fine. The objective: However, what I am aiming for is to automate these actions to ...

Troubleshooting: @media query's max-width CSS property not functioning as expected

(The styling works on all browsers except Chrome) I am trying to apply a specific style only when the browser width is less than 1400px Unfortunately, using max-width is not producing the desired effect @media only screen and (max-width:1400px) { .head ...

Creating customized JQuery UI tabs to perfectly accommodate the available horizontal space

Can JQuery UI Tabs be modified to fill the horizontal space and stack to the left? In order to achieve this, could we consider using a markup like the one below: <table width="100%"> <tr> <td> ...content... </td> ...

Setting the title of the master page body dynamically

Looking for a solution similar to the one discussed below, I am attempting to extract the title entered in the title tag on each page and use it to update an asp label dynamically to display the title on each page. My goal is to achieve this using only C# ...

Is there a tool available for viewing the HTML5 Web SQL database?

Is there a tool available, such as PHPMyAdmin, that allows users to easily view HTML5 Web SQL databases from their web browser? ...

Set the height of the main div container to a fixed size

I am facing an issue with my div container (mapInfo-Container) which contains multiple div blocks. I want the container to have a fixed height of 250px, and be scrollable for any content exceeding this height. Here is the code snippet: http://jsfiddle.net ...

The styles from bootstrap.css are not displaying in the browser

Currently in the process of setting up my angular 2 project alongside gulp by following this helpful tutorial: I've added bootstrap to the package.json, but unfortunately, it's not reflecting in the browser. I can see it in the node_modules and ...

The styles within a media query are not being successfully implemented

update: issue resolved. I discovered that there was a lingering media query in the css file that was meant to be removed. Also, I corrected some errors in the code. Thank you all for your help – it's now working perfectly. I have a set of html and ...

Using jQuery to arrange information from an API into a table

Currently, I am in the process of learning jQuery as it is a new concept for me. I have attempted to make a request to an example API and received an array of objects that need to be listed in a table. However, I am facing difficulty in sorting it within t ...

Using -moz-transform CSS does not effectively prevent unwanted page breaks when printing in Firefox

I am facing a challenge with printing two tables, named header and details, on separate pages. The structure of the tables is as follows: <table id="header"> <!-- multiple rows here --> </table> <table id="details&quo ...

Can you show me how to extract the html code from a website using python's requests module?

Attempting to retrieve an HTML file from the specified website: Inspecting the source in Google Chrome allows me to obtain the HTML without any difficulty. However, I aim to download multiple pages using Python requests. Unfortunately, when attempting to ...

What's the CSS equivalent of Java's window.pack() method?

I'm relatively new to css and I'm attempting to create a border around a <div>. My goal is for the border to be limited to the size of the elements inside the div and adjust dynamically in proportion to any new objects that may appear or di ...

What measures can be taken to ensure that the input checkbox is not toggled by accidentally pressing

There's a checkbox input in a dropdown menu at the top of the page that is giving me some trouble. When I select an option by clicking on it, for some reason pressing the spacebar toggles it off and on. Clicking outside once doesn't correct it, I ...

Tips for adjusting UI with Media queries based on screen dimensions

Looking for a better solution I currently have 5 sets of items. Button Text Dropdown Pagination Icon For larger screen sizes, specifically @media (min-width: 990px) {} I would like all items to be in a single row, like so: [button][Text][Dropdown][Pagi ...

What is causing Safari to block styling for <em> elements in RESET.CSS only?

I am utilizing Eric Meyer's reset.css file, which can be found at this link: Interestingly, my <em> definition in my main stylesheet is working perfectly fine on all browsers except Safari. Somehow, only in Safari, the styling for italics is no ...

Setting the width of a wizard modal to auto

I am facing an issue with my modal wizard. The width of the first modal is perfect, but when I navigate to the second and third modals by pressing next, they automatically take on a fixed width size that I need to modify. I have tried declaring the width ...

Click and keystroke fusion

Greetings everyone, I've been attempting to integrate both click and keypress functionalities into my function, but unfortunately, nothing I've attempted so far has yielded any success. Here's the code snippet: function victoryMessage() { ...