Irregular Button Designs in Bootstrap 4

I am facing an issue with the button width in a bootstrap 4 list. All buttons are set to btn-block, but the last one appears wider than the others. I can't seem to figure out why this is happening as the CSS modifications made do not affect the width. Can someone provide any insight? The Instagram button seems to be the culprit based on the attached image below. Code snippet will follow.

https://i.sstatic.net/uX4Dy.jpg

<header class="construction-header">
  <div class="container">
    <div class="construction-message">
      <h1><img src="http://jessetoxik.com/img/header/logo/logo_temp.png"></h1>
      <h3 class="fjalla">Webpage Coming Soon</h3>
      <h3 class="release fjalla"></h3>
      <hr class="construction-divider">
      <ul class="list-inline construction-social-buttons fjalla">
        <li class="list-inline-item">
          <a href="https://example.com" class="btn btn-secondary btn-lg btn-drk btn-block">
            <i class="fa fa-twitter fa-fw"></i>
            <span class="network-name">Twitter</span>
          </a>
        </li>
        <li class="list-inline-item">
          <a href="https://www.example.com/" class="btn btn-secondary btn-lg btn-drk btn-block">
            <i class="fa fa-facebook fa-fw"></i>
            <span class="network-name">Facebook</span>
          </a>
        </li>
        <li class="list-inline-item">
          <a href="https://www.example.com" class="btn btn-secondary btn-lg btn-drk btn-block">
            <i class="fa fa-instagram fa-fw"></i>
            <span class="network-name">Instagram</span>
          </a>
        </li>
      </ul>
    </div>
  </div>
</header>


body, html {
  width: 100%;
  height: 100%;
}

body, h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  text-shadow:
   -1px -1px 0 #000,  
    1px -1px 0 #000,
    -1px 1px 0 #000,
     1px 1px 0 #000!important;
}

.construction-header {
  padding-top: 50px;
  padding-bottom: 50px;
  text-align: center;
  height: 100%;
  color: #f8f8f8;
  background: url('imagesrc') no-repeat center center;
  background-size: cover;
}

.construction-message {
  position: relative;
  padding-top: 20%;
  padding-bottom: 20%;
}

.construction-message>h1 {
  margin: 0;
  text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.6);
  font-size: 5em;
}

.construction-divider {
  width: 400px;
  border-top: 1px solid #f8f8f8;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.construction-message>h3 {
  text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.6);
}

.construction-social-buttons i {
  font-size: 80%;
}

@media(max-width:767px) {
  .construction-message {
    padding-bottom: 15%;
  }
  .construction-message>h1 {
    font-size: 3em;
  }
  ul.construction-social-buttons>li {
    display: block;
    margin-bottom: 20px;
    padding: 0;
  }
  ul.construction-social-buttons>li:last-child {
    margin-bottom: 0;
  }
  .construction-divider {
    width: 100%;
  }
}
.btn-drk {
   background-color: #232323!important;
}

Answer №1

If I had a working sample to reference, testing would be more effective. One workaround I came across is using Bootstrap's Grid instead of .list-inline to organize the buttons. This approach offers flexibility in displaying the buttons in either a single row or stacked based on the device width.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" type="text/css" rel="stylesheet">

<div class="container">
  <div class="row">
    <div class="col-12 col-sm-4 my-2">
      <a href="https://example.com" class="btn btn-secondary btn-lg btn-drk btn-block"><i class="fa fa-twitter fa-fw"></i><span class="network-name">Twitter</span></a>
    </div>
           
    <div class="col-12 col-sm-4 my-2">
      <a href="https://www.example.com/" class="btn btn-secondary btn-lg btn-drk btn-block"><i class="fa fa-facebook fa-fw"></i><span class="network-name">Facebook</span></a>
    </div>
      
    <div class="col-12 col-sm-4 my-2">
      <a href="https://www.example.com" class="btn btn-secondary btn-lg btn-drk btn-block"><i class="fa fa-instagram fa-fw"></i><span class="network-name">Instagram</span></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

Guide on extracting data from a JavaScript table using Python

Looking to extract information from a table on this page: . There are a total of 18 pages, but the url remains constant for each page. My usual method involves using BeautifulSoup to scrape data from HTML pages. However, in this case, the required data is ...

Conceal website elements using jQuery or CSS techniques

Is it possible to hide the content between parentheses in the following HTML using CSS or jQuery? The challenge is that the parentheses and text inside them are not wrapped in any div, making it difficult to target with CSS. <span> <a class ...

What causes external CSS to take precedence over embedded CSS in my webpage?

As per a certain source, conflicting CSS styles on the same element should be overridden by embedded styles over external styles, but my observation proves otherwise. My HTML code (simplified version) is as follows: <html> <head> <link r ...

Is there a way to verify if a specific combination of keys has been pressed using JavaScript?

Currently, I am creating a software application that requires the integration of custom hotkeys. These hotkeys need to be chosen by the user and stored for future use. For instance, if the user selects CTRL + M, how can I save this combination and trigge ...

Moving objects from one container to another and organizing them

I have multiple small divs (referred to as "inner-div") and several container divs. My goal is to be able to drag the inner-divs to different container-divs and have them automatically rearrange within the new container. I have already set up the divs an ...

Ways to create an underlined text effect using CSS

Can you help me style my two <a> tags so they appear underlined? I can't use border-bottom: dashed 10px because the lines are thin and there is too much space between them. .t1 { color: #8bb09e; } .t2 { color: #ffee90; } <a href= ...

Modifying Bootstrap 5 color themes does not affect the button color classes

After following the steps outlined in this guide, I successfully customized the default colors of Bootstrap 5 in my React application created using create-react-app. Within my /src/scss/custom.scss file, I can easily utilize any newly defined variables and ...

The module 'angular' could not be located and is causing an error

Currently, I am in the process of transitioning from Angular 1 to Angular 2 following this guide: . However, when I try to run the application using npm start, it displays an error saying 'Cannot find module 'angular''. This is a snipp ...

Trouble with CSS animation when incorporating JavaScript variables from a PHP array

Whenever I use a script to fetch an array of objects from PHP... I successfully display the results on my website by outputting them into Divs. The challenge arises when I introduce CSS animations. The animation only triggers if the variable length excee ...

Tips for presenting a label and its value on separate lines while also displaying additional nested label-value pairs:

I have a specific request in mind, https://i.sstatic.net/aK5nG.png But the result I am seeing is different, https://i.sstatic.net/ajvhF.png Here's the code snippet, I'm utilizing bulma framework but encountering some challenges... <sectio ...

Tips for extracting an XML value from an API

I'm attempting to showcase a value retrieved from an API (specifically used by PRTG software to extract information). Here is the link to the API: The API provides an XML file structured like this: <?xml version="1.0" encoding="UTF-8"?> <ch ...

Webpack double fires its function

I have implemented a feature on my website where an HTML page is loaded using AJAX without refreshing the entire page. Everything seems to be working correctly, but I have noticed that whenever the AJAX page is loaded, it triggers the webpack function twic ...

What is the best way to apply styling exclusively to a child component?

I am currently working on a coding project that involves a parent component and multiple child components. My main goal is to adjust the position of a filter icon by moving it down 5 pixels on one specific child component. The issue I am facing is that no ...

I would like to terminate the property when processing it on a mobile device

<div class="col-sm-24 embed-responsive"> <iframe width="100%" src="http://www.youtube.com/embed/${item.snippet.resourceId.videoId}"></iframe> </div> .embed-responsive iframe { height: 185px; margin-top: -4%; paddin ...

Issue with backdrop-filter blur effect not functioning correctly

I'm currently utilizing SCSS and within my _header.scss file, I am importing it into my main.scss like so: @use "header"; Here is the snippet of code from my header file (I've removed some less important details such as borders, margin ...

Attempting to display divs at the bottom when hovering over menu options

I need help troubleshooting my HTML and CSS code. I want to be able to hover over a menu item and have the corresponding div appear at the bottom. Can you point out what's wrong with my code? <!DOCTYPE html> <html> <head> &l ...

Incorporating dynamic HTML templates onto a webpage using JavaScript/jQuery for seamless

Looking for a solution to a coding issue I'm facing. Here's the situation: <template id="photo-template"> <div class="template-border"> <p class="name"></p> </div> </template> I need to displa ...

How to customize an unordered list in a WordPress theme using Bootstrap 4

I am currently struggling with a frustrating problem where I cannot seem to style the ul list properly. I have tried various solutions, such as using # instead of . when targeting the "socials" class, but nothing seems to work. Below is my code: html: & ...

Troubleshooting email form validation issues in Vue.js

Even after entering the email id, I am still receiving the error message stating that the email is required. Here is a screenshot for reference: . I want the error message to be hidden when the email id is entered. HTML: <form class="footer-f ...

Can you provide the URL for the mailto function on a webpage?

Is it possible to activate the "mailto" email address directly via URL on a webpage? For example, if you have an email address listed as [email protected], would clicking the URL in the browser open the mail client just like clicking the email address its ...