Make a gap between two buttons on my banner

How can I create a space of 0.5 cm between 2 buttons in my banner? I have been stuck on this for a while now. Do I need to modify my HTML blocks? https://i.sstatic.net/74yBh.png

Below is the CSS code I am currently using:

.myButtonRegister{
  float: left;
  background-color: #C22312;
  color: white;
  height: 48px;
  width: 168px;
  text-align: center;
  font-family: 'Pridi', serif;
  font-size: 26px;
  padding-top: 10px; 
}
.myButtonRegister a {
  color: #f2f2f2;
  text-decoration: none;
}
.myButtonLogin{
  float: left;
  background-color: black;
  color: white;
  height: 48px;
  width: 168px;
  text-align: center;
  font-family: 'Pridi', serif;
  font-size: 26px;
  padding-top: 10px; 
}
.button-action {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
}

Any suggestions on how to achieve the desired spacing? Thank you for your input. Best regards

Answer №1

To enhance the appearance of your myButtonRegister class, you should include the margin-right: 30px; attribute.

.myButtonRegister{
 float: left;
 background-color: #C22312;
 color: white;
 height: 48px;
 width: 168px;
 text-align: center;
 font-family: 'Pridi', serif;
 font-size: 26px;
 padding-top: 10px;
 word-spacing: 0px;
 margin-right: 30px;
}

Answer №2

Be sure to include the following line within the myButtonRegister class:

 margin-right:10px;

Feel free to adjust the value of 10px to suit your preferences. I hope this information proves useful.

Answer №3

Have you considered adding the following rule to the .myButtonRegister class: margin-right: 50px;

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 method for eliminating underscores from text that is hyperlinked in a locally hosted HTML file?

I recently encountered an issue with my HTML file where the text "Indian" became underlined after saving the file. Here is the code snippet: <a href="file:///G:\work files\project\indian.html" target="_blank"> <div class="button ...

jquery selector targeting a select optiongroup that contains a specific label value

In my code, I have a select multiple with option groups: <select _ngcontent-oeq-14="" class="form-control" id="category-select" multiple=""> <optgroup label="grocery products"> <option>meat</option> <option>dai ...

What steps should be taken to incorporate that dynamic sliding element (like a sliding screen paper) on the webpage?

When hovering over the leftmost part of the homepage at www.techants.com, a box shifts to the foreground. I examined the code and noticed a reference to something called screen paper. Does anyone know which script is being used for this effect? How can I ...

Is there a way to combine JavaScript, CSS, and HTML code in a single HTML document?

Is there a way to include both <script> and <style> elements within the same HTML body? <html> <head> <title>My site title</title> </head> <body> </body> </html> I am looking to in ...

javascript variable pointing to an unknown object

Below is the essential code snippet to consider: JS function ToggleRow(objTwistie, objRow) { if (objRow.style.display == "none") { objRow.style.display = ""; objTwistie.src = "../Images/SectionDown.gif"; } else { objRow.style.display = "n ...

When the button is left alone, its color will change

<!DOCTYPE html> <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <bod ...

Using HTML to design interactive buttons that can send API requests and display their current status

Seeking assistance with creating buttons to control a remote light's ON and OFF states while reflecting their status as well. The specific http API calls for the light are necessary to toggle its state. Turn On = http://192.168.102.22:3480/data_requ ...

Unlock the innerHTML of a DIV by clicking a button with ng-click in Angular JS

I am curious about something. There is a <div> and a <button> in my code. I am looking to access the inner markup of the <div> within the ng-click function without relying on jQuery. Can you give me some guidance? <div id = text-entry ...

The alignment of my text appears to be off

I am facing an issue with the second <ul> on my webpage, which contains more content compared to the first one. In this second <ul>, the last line is appearing floated to the left and does not appear below the penultimate line as expected. Li ...

Is it possible for two Bootstrap icon class names to be used sequentially with one taking precedence over the other?

I am having an issue with toggling a class name in my code. I have a class named (bi bi-clipboard) and I want to change it to (bi-clipboard-check) when it is clicked. However, the problem is that the new class name gets added next to the existing one like ...

Trouble with displaying label in PDF post HTML conversion using iText html2pdf

Software Versions: html2pdf v2.0.1 iText 7.1.1 The HTML label that spans the width of the page is as follows: <label class="test">Patient</label> CSS Styling: .test { display: block; font-weight: bold; color: #009fd1; font ...

Struggling to dynamically resize 2 boxes using JavaScript

I am attempting to create a layout with two Divs side by side, each containing slightly different content. I have successfully resized them equally using JavaScript, but the issue arises when loading the collapsed content as it does not adjust to the new s ...

Sending an AJAX request when refreshing a page segment

I have recently registered, but I have been a silent reader for years. Up until now, I have managed to find the answer to all my questions by searching on Stack Overflow. However, I am faced with a new challenge... I am new to AJAX and I am in the process ...

Switch up the linear gradient background periodically

Is there a way to change the background after a certain amount of time? It seems to work fine if the background color is just a solid color, but when it's a gradient as shown in the code below, the solution doesn't seem to work. Any suggestions f ...

Using Python and Django to Populate Form Fields in a Model with values from an Imported JSON dataset

I am facing a challenge where I have a model form that stores all user inputs from form fields into the database as one entry. Additionally, I possess a JSON file with numerous JSON objects whose attributes correspond to the form field of the model. This ...

What steps can be taken to resolve this issue?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ut ...

Animate the Bootstrap carousel from top to bottom instead of the traditional left to right movement

Is there an option available in the bootstrap carousel to animate it from top to bottom and bottom to top, rather than from right to left and left to right? jsFiddle link <div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval=" ...

Display and conceal information upon tweeting

Can anyone help me troubleshoot an issue with hiding the Twitter button after displaying new content? I tried adding a script to make it work, but it's still not functioning properly. Any insights on what I might be doing wrong would be greatly apprec ...

A dynamic Angular search box designed for filtering columns in a table

I have a functioning table code that displays data related to domains: Now, I would like to enhance this table by adding a dynamic search box specifically for filtering the column named domain. As the user types in new characters in the search box, the ta ...

Unable to display <iframe> containing a YouTube video on Mozilla Firefox page

I have included an <iframe> in my webpage to display videos from YouTube, but I am facing an issue with Mozilla Firefox. In Chrome, IE, and Edge, the videos display correctly using the following code: <iframe src="http://www.youtube.com/v/DNLh8p ...