Create gaps between two buttons in HTML without using CSS

I created two buttons and aligned them to the right side of the page, but they are stuck together without any space in between. I tried adding a margin of 30px, but they both moved together.

<button type="button" class="btn btn-primary" style="float: right; margin-right: 30px;">Login</button>
<button type="button" class="btn btn-secondary" style="float: right; margin-left: 30px;">Register</button>

Below is an image of the two buttons I created:

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

Answer №1

It appears that you are utilizing bootstrap. Here are some classes you can incorporate into your bootstrap code:

<button type="button" class="btn btn-primary float-right">Login</button>
<button type="button" class="btn btn-secondary float-right mr-3">Register</button>

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

  • replace inline style with the float-right class.
  • use the mr-x class to add margin (x => 1,2,3,4,5).

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

Displaying certain properties conditionally on an HTML document is a necessary

Is there a way to dynamically display an asterisk on a required field based on the value of a selected radio button using JavaScript? <p class="signatoryLabelAdditional" ng-class="{required:!currentQuoteQto.preferredBillingCity}" translate>qrDe ...

Mistake in labeling a checkboxgroup in ExtJs4.2 by wrapping a boxLabel incorrectly

I am encountering an issue where the box labels of the checkboxes are wrapping under the checkbox: http://jsfiddle.net/6pYWh/ { xtype: 'checkboxgroup', columns: 1, vertical: true, items: [ ...

Joomla website layout using Bootstrap columns set to MD-6 but not contained within a single

I seem to be experiencing an issue with Joomla SP page builder. After creating a row and adding 2 columns MD-6, they are not lining up properly in one row. Any assistance would be greatly appreciated. You can view the issue at: Here is a screenshot of t ...

What is the best way to eliminate the unwanted white space below the footer on a webpage

I'm working on a website and I've noticed that at the end of the footer, there is a large block of white space that shouldn't be there. I've tried adjusting the HTML and CSS code, but nothing seems to fix the issue. Strangely, other pag ...

Ways to repair a website iframe malfunction

Whenever I visit this specific URL : (note: using an Ad-blocker is recommended) The link to the webpage loads properly, with no issues. However, attempting to load the same page through an iframe in my HTML code triggers an error: Here is my HTML code : ...

Aligning elements within a table to ensure consistency with surrounding content

Issue I am working with an html table that includes a particular column whose content can vary in size. This results in rows of varying heights, which is expected. However, the adjacent column to the variable-sized one contains two buttons that consistent ...

Overriding the !important declaration in inline styles within various CSS IDs and classes

I need to find a way to override an inline !important declaration that is nested inside multiple CSS ids and classes. Let's analyze the following situation: <div class="A"> <div class="B"> <div class="C"> < ...

What is the best way to right-align navigation using bootstrap?

We are struggling to align our navigation items to the right side of our page. Despite using a container class and align-items-end, we have not been successful in achieving this. We must confess that this section is somewhat hastily put together, and we do ...

Integrating a feature for displaying No Results Found

I am struggling to modify a script for auto-completing search fields. My goal is to include a "No Results Found" option along with a hyperlink when no matching results are found. I'm having difficulty figuring out how to add an else statement to displ ...

I'm looking to use JavaScript to dynamically generate multiple tabs based on the selected option in a dropdown menu

I'm reaching out with this question because my search for a clear answer or method has come up empty. Here's what I need help with: I've set up a dropdown titled 'Number of Chassis'. Depending on the selection made in this dropdown ...

The smooth scrolling function in jQuery is producing unexpected outcomes

I'm trying to implement smooth scrolling on my website. However, the scrollbar is not working as expected. It seems like the smooth scrolling and default jumping to anchor links are happening at the same time. Here is my HTML code for the Bootstrap ...

Safari causing margin problems

Encountering a margin problem specifically with Safari that I'm having trouble debugging. While everything functions properly in Firefox, Chrome, IE, etc., Safari presents issues. My content div is positioned just below the header, but in Safari, it o ...

Blend a background image using rgba without incorporating a gradient effect

Can you merge a background image with an rgba color without resorting to an rgba gradient? My current CSS3 style appears as follows: html { background: linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.75)), url("../icons/sombrero.jpg")no-repe ...

Angular, PHP, and MySQL working together to establish database connectivity

Greetings! I am facing some challenges with a small project involving mySQL and PHP for the first time. My main focus right now is on establishing connectivity. Despite following various tutorials, I have been unable to connect to the database and keep enc ...

lines stay unbroken in angular

I am encountering an issue when I execute the following code: DetailDisplayer(row) : String { let resultAsString = ""; console.log(row.metadata.questions.length); (row.metadata.questions.length != 0 )?resultAsString += "Questions ...

Troubleshooting Logo Size Problems: Converting from Figma to HTML and CSS

I've been working on designing a landing page using Figma and overall it's looking great. However, I've run into some issues with my images, particularly with my logo. Figma provides specific width and height dimensions for my logo, but when ...

Step-by-step guide on preventing an item from collapsing in a Bootstrap navbar

Is there a way to exclude a specific item from the navbar collapse box when the screen size becomes small? Here is the current HTML code: <div class="container"> <nav class="navbar navbar-default"> <div class="container-fluid"> ...

What can I do to stop my list items from dropping below the menu even when there isn't enough space?

I'm facing an issue with my menu and despite several attempts, I can't seem to resolve it. In Firefox, everything looks fine, but in other browsers, the last anchor tag inside my menu keeps collapsing underneath. I've tried various solutions ...

How can I choose an expandable element using Selenium?

I am currently facing issues while trying to select an element on a webpage using selenium. The element in question is expandable, and when clicked, it reveals other items/fields. Here is the code snippet for the element: <DIV class="section"> ...

Challenges with text formatting on various devices such as PCs, tablets, iPhones, and iPads in both portrait and landscape orientations

I have been experimenting with establishing a standard for font sizes in CSS, but I am facing challenges due to variations in devices and resolutions. Font sizes that work well on one device may not appear as intended on another, especially when switching ...