Personalize the design of bootstrap buttons

I am looking to increase the size of my bootstrap buttons beyond btn-lg.

Here is my current code:

HTML

Whenever I add a new class with padding to the anchor tags, it ends up looking strange.

https://i.sstatic.net/3AFPI.png

However, this is the desired outcome (The image shows what it looked like before adding the anchor tag with the btn classes):

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

Thank you in advance.

Answer №1

My attempt at implementing the same solution went smoothly without any hiccups. To further clarify, I have provided a link to the code below.

body {
  padding: 10px;
}

.container .btn-outline-success {
  border: 1px solid #777;
  padding: 0 20px;
  min-width: 130px;
  height: 60px;
  line-height: 60px;
  margin-right: 10px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />

<div class="container">
  <a class="btn btn-outline-success btn-lg" href="coderesource.html" role="button">HTML</a>
  <a class="btn btn-outline-success btn-lg" href="coderesource.html" role="button">CSS</a>
  <a class="btn btn-outline-success btn-lg" href="coderesource.html" role="button">Javascript</a>
</div>

Answer №2

The issue at hand may not be caused by applying any of those classes to the anchor tag, but rather by the containers surrounding the anchors.

To achieve the desired outcome, consider using a flexbox with the .justify-content-between property within a row. This will ensure that the buttons have equal horizontal spacing between them and fill the row. You can also add padding to the buttons using Bootstrap 4's padding classes. Alternatively, you can create a custom class with padding, just remember to use !important if needed. Here is a working example:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="col-12 d-flex justify-content-between">
<a href="#" class="btn btn-lg btn-outline-success px-5 py-3">HTML</a>
<a href="#" class="btn btn-lg btn-outline-success px-5 py-3">CSS</a>
<a href="#" class="btn btn-lg btn-outline-success px-5 py-3">JavaScript</a>
</div>
</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

Customizing text inputs in three.js

Why are the HTML textboxes disabled for input when the "render" button is working properly? I have tried changing the render.domElement to different elements on the page such as container, info, parent, and scene, but I cannot figure out the reason for t ...

Building a custom HTML and JavaScript player to showcase multiple videos on a webpage

UPDATE: The solution has been discovered, shared, and marked as the top answer below. In the process of creating my portfolio website using HTML, CSS, and JS, I encountered a challenge regarding the addition of multiple videos on various pages. While fol ...

I can't figure out why the navigation bar in my Rails app is displaying vertically instead of horizontally

My Rails app has a navbar crafted with Bootstrap, but it's displaying vertically instead of horizontally. To see the issue in action, you can visit the app here. Despite referencing several articles on the topic (listed below), the problem remains unr ...

After the modal is displayed, my function is loaded multiple times

I've been working on implementing toastr to display an account alert when the modal opens. However, I'm encountering an issue where the alert multiplies every time I open the modal. The first time it opens, everything works perfectly - one alert ...

What is the best method for securing my API key within the script.js file while utilizing dotenv?

My goal is to conceal my API key using dotenv. Interestingly, when I replace require('dotenv').config(); with my actual API key in the code as apiKey: process.env.API_KEY, it works fine despite not using process.env.API_KEY. I made sure to inst ...

What is the best way to keep a <div> class anchored to the bottom of an HTML page?

I am looking to incorporate a footer into my website that stays fixed at the bottom of the screen. However, I have encountered an issue: Here is what I have attempted so far: .footer { position: absolute; width: 100%; background: #0084FF; ...

Querying val results in an empty string being returned

In my application, I have the following HTML code snippet: <tr style="cursor:pointer;"> <td>100101</td> <td>Monkey</td> <td>Nuts<td> <td>Cow</td> <td>Soup</td> <t ...

Ideas for obtaining dynamic HTML content using Selenium?

I'm currently working on developing a web crawler in Python that can analyze the HTML of a website and search for all href tags. However, I've found that libraries like Beautiful Soup do not allow me to access the dynamic content generated by scr ...

Attempting to retrieve the current time using JavaSscript

const currentTime = new Date(); const hours = now.getHours(); Console.log(hours); This block of code is returning an error message... Uncaught ReferenceError: now is not defined Please note that this snippet is written in JavaScript. I attempted to us ...

Customizing the scroll bar hue on Safari for Lion operating system (OS X 10.7)

In Lion, the new scrollbars in Safari change color based on the background color of the body element. Is there a way to manually control whether the scrollbar is dark or light? I am aware of webkit CSS options to style the scrollbar that existed before t ...

Adding animation to the CSS property of display:none changing to display:block using JavaScript

Recently, I came across a code snippet that handles the visibility of a button using JavaScript. The code includes both HTML and JavaScript portions. HTML <div id="butStyle"> <button id="langBut">Language</button> ...

Hide object scroll percentage with CSS styling

Is there a way to dynamically hide an element based on the user's scrolling behavior? I have incorporated floating social buttons into my website, and I am looking for a solution that will hide them when the user reaches the bottom of the page (foote ...

Presenting two arrays simultaneously creates angular duplicates

Encountering an issue while trying to display two arrays containing channel information: List of channels List of subscriptions that users have opted for. channels = [ { "id": 1, "name": "arte", "service&q ...

Adding space and arranging the cards in a horizontal layout using Bootstrap

I'm working on a code and an HTML page with Bootstrap enabled. The current setup simply displays three bootstrap cards with images vertically on the page. Now, I would like to: a) Add a margin from the left-hand side. b) Display the cards horizontal ...

Incorporate a platform-specific button in a user interface with React Native

I need to display a button that is only shown on iOS, not on android. I have tried using the following style, but it doesn't seem to be working. ...Platform.select({ android: { display:'none', }, The code for my button is: <Bu ...

Instantly display content within a div using the jQuery Address plugin when accessing a bookmarked page

I have encountered an issue while using the jquery.address plugin to update my browser's address bar when loading content via ajax. Everything seems to be working fine, with one exception - I am unable to automatically load the event.value or event.pa ...

ASP.NET Dynamic Slideshow with Horizontal Reel Scrolling for Stunning

I'm curious if there is anyone who can guide me on creating a fascinating horizontal reel scroll slideshow using asp.net, similar to the one showcased in this mesmerizing link! Check out this Live Demo for a captivating horizontal slide show designed ...

What is the best way to overlay a two-line heading onto an image background?

I'm struggling to position a text heading directly over an image in the center without it getting cut off. Any ideas on how to achieve this? <header class="text-center"> <img src="img\blueskycrop.jpg" class="img-fluid" alt="bluesky"> ...

When you hover over the button, it transforms by changing its font weight and removing its border

I attempted to enhance the appearance of a button by removing its border and making the font bolder. I used this simple CSS code: .button { ... font-weight: 500; border: none; } .button:hover{ font-weight:600; border: 1px solid red; } However, instead of ...

What is the best way to serve my HTML and CSS files using my NODEJS server?

I have set up a nodejs server with the following code. Currently, I haven't included any references to HTML or CSS in the code because I am unsure how to do that. const http = require('http'); // Create an instance of the http server to ...