Issue with visibility of Bootstrap modal title

The title in the modal isn't visible.

Even when I highlight it with a mouse, it still doesn't show up. I attempted to add modal-content color: #000, but unfortunately, it had no effect.

As of 01/11/16 1:28PM CST, none of the responses and answers provided have solved the issue.

I forgot to mention that I'm currently using Bootstrap 4 Alpha version. Despite checking out the modal section of version 4 for any changes, setting top: 100px was the only thing that worked. Any further suggestions are welcome!

Can anyone spot what might be wrong within the HTML code?

<button class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal">
        Newsletter
    </button>
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
         aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <!-- Modal Header -->
                <div class="modal-header">
                    <button type="button" class="close" 
                       data-dismiss="modal">
                           <span aria-hidden="true">&times;</span>
                           <span class="sr-only">Close</span>
                    </button>
                    <h4 class="text-body modal-title" id="myModalLabel">
                        Subscribe to Newsletter
                    </h4>
                </div>
                <div class="modal-body">
          <form class="form-signin">
            <h2 class="form-signin-heading">Receive Our Newsletter</h2>
            <label for="inputEmail" class="sr-only">Name</label>
            <input type="email" id="inputEmail" class="form-control" placeholder="Name" required autofocus>
            <label for="inputEmail" class="sr-only">City &amp; State</label>
             <input type="email" id="inputEmail" class="form-control" placeholder="City &amp; State" required autofocus>
            <label for="inputPassword" class="sr-only">Email address</label>
            <input type="password" id="inputPassword" class="form-control" placeholder="Email Address" required>
        <hr>
            <button class="btn btn-lg btn-primary btn-sm" type="submit">Subscribe</button>
          </form>        
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">Close</button>
          </div>
        </div>
        </div>
      </div>

Answer №1

.modal-title {
    font-weight: bold;
}

Answer №2

I encountered a similar issue and discovered that the problem was due to using an incorrect version of bootstrap css.

I needed to remove the fade css class.

In this particular situation, here is what you currently have:

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
 aria-labelledby="myModalLabel" aria-hidden="true">

The correct code should be:

<div class="modal" id="myModal" tabindex="-1" role="dialog" 
 aria-labelledby="myModalLabel" aria-hidden="true">

Answer №3

            <em>
            <h3 class="popup-title" id="subscribeLabel" >
                Sign Up for Our Newsletter
            </h3></em>

Answer №4

When viewing your code with some formatting, the bootstrap 4.2 code should be placed in an HTML file for it to work properly.

Remember, you need to include your own stylesheet for it to function correctly.

<html>
    <head>
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
        <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
    </head>
    <body>
        <button class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal">
            Newsletter
        </button>

        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">
                            <span aria-hidden="true">&times;</span>
                            <span class="sr-only">Close</span>
                        </button>

                        <h4 class="modal-title" id="myModalLabel">
                            Subscribe to Newsletter
                        </h4>
                    </div>

                    <div class="modal-body">
                        <form class="form-signin">
                            <h2 class="form-signin-heading">Receive Our Newsletter</h2>
                            <label for="inputEmail" class="sr-only">Name</label>
                            <input type="email" id="inputEmail" class="form-control" placeholder="Name" required autofocus>
                            <label for="inputEmail" class="sr-only">City &amp; State</label>
                            <input type="email" id="inputEmail" class="form-control" placeholder="City &amp; State" required autofocus>
                            <label for="inputPassword" class="sr-only">Email address</label>
                            <input type="password" id="inputPassword" class="form-control" placeholder="Email Address" required>
                            <hr>
                            <button class="btn btn-lg btn-primary btn-sm" type="submit">Subscribe</button>
                        </form>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">Close</button>
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>

Answer №5

To style the header tag with the modal title, make sure to apply the class="text-body"

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

Design interactive elements such as buttons and input fields inspired by the layout of Google websites

Does anyone know how to achieve the sleek, lightweight buttons and text boxes seen on Google's web pages like Google Search, Google Plus, and Google Play? I am currently using JSP and CSS, but I am open to incorporating jQuery if necessary. Any help w ...

Download and print the embedded PDF file

I am having trouble figuring out how to add 2 external buttons to print and save an embedded pdf on my webpage. Despite searching Google for hours, I have not been able to find a solution that works. The embedded object already has buttons for printing and ...

Insert the entered value into the table

I'm struggling to extract the content from an input textfield and insert the value into a table row. However, every time someone submits something, the oldest post shifts down by one row. Below is my current attempt, but I'm feeling quite lost at ...

Transforming the header to function similarly to the address bar in the Google Chrome mobile app

I have managed to create a fixed header that appears when the user scrolls up and disappears when they scroll down. However, I want it to behave like the address bar on the Google Chrome mobile app - remaining stationary until the top of the window reaches ...

Understanding CSS classes in ReactJS Material UI componentsJust wanted to clarify some things

When it comes to styling Material UI components, the recommended approach is to utilize their useStyles function. Here's an example: const useStyles = makeStyles(theme => ({ root: { marginTop: '15px', display: 'f ...

Tips for entering Tamil characters in text boxes on a form field

Within my form, I have a set of text boxes. I am looking to input text in Tamil font for specific text boxes - around 5 out of the total 10 text boxes in the form. If you know how to enable Tamil font input for multiple text boxes (rather than just one as ...

Enhance Prime-ng dropdown child elements with customized styling

Currently, I am attempting to apply styles to elements within a PrimeNG dropdown. These particular styles are associated with child elements nested within the p-dropdown tag, and I am unsure of the proper method to target them. Below is a snippet of the co ...

Proper method for adding elements in d3.js

I have a block of code that selects an #id and appends a svg-element into it: var graph = d3.select(elemId).append("svg") .attr('width', '100%') .attr('height', '100%') .append('g') Within th ...

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 update the value of a variable with the help of a checkbox?

When I check the checkbox, the specOrder const gets updated as expected. However, I am struggling to figure out how to remove the value when the checkbox is unchecked. Below is the code I have been working on: const SpecialtyBurgers = () => { cons ...

Strategies for optimizing progressive enhancement

Designing a website that is accessible to everyone is truly an art form, and Progressive Enhancement is something I hold dear... I am curious to hear about the best techniques you have used to ensure websites work for all users, regardless of their browse ...

Steps to create a zigzagging line connecting two elements

Is it possible to create a wavy line connecting two elements in HTML while making them appear connected because of the line? I want it to look something like this: Take a look at the image here The HTML elements will be structured as follows: <style&g ...

Create a stylish navigation dropdown with MaterializeCSS

Incorporating the materializecss dropdown menu feature, I encountered an issue where only two out of four dropdown menu items were visible. Here is the HTML code snippet in question: <nav class="white blue-text"> <div class="navbar-wrapper con ...

Fontawesome is unable to update the class due to the presence of invalid characters in the string

const toggleDarkOrLight = document.getElementsByTagName('i')[0]; var toggled = false; const toggleFunction = () => { if (toggled === false) { toggleDarkOrLight.classList.remove('fa fa-toggle-off'); toggleDarkOrLight.classLi ...

CSS3 Feature: Chevron-shaped banner with jagged edges

I'm currently working on building a unique chevron-style banner using CSS3, but I've run into some aliasing problems specifically in Chrome. Despite trying to utilize the -webkit-backface-visibility: hidden attribute, I still can't seem to r ...

ng-init assign value to a new object

<!DOCTYPE html> <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> <body> <div ng-app="myApp" ng-controller="myCtrl2" ng-init="person = new Person('Al ...

retrieving embedded content from an iframe on Internet Explorer version 7

Need help with iframe content retrieval $('.theiframe').load(function(){ var content = $(this.contentDocument).find('pre').html(); } I'm facing an issue where the iframe content is retrieved properly in FF, Chrome, and IE 8,9 ...

What steps should I take to ensure that my Ngrok domain is functioning properly?

Screenshot of Endpoints I've been facing challenges while attempting to get my NGROK domain operational. Despite completing all the necessary setup steps and successfully running multiple tunnels simultaneously with NSSM, as well as having a business ...

The button appears flawless in Chrome and Firefox, but unfortunately fails miserably in Internet Explorer. Is there any way to make it functional in all

Check out this JFiddle link: http://jsfiddle.net/Zfnz2/ I'm seeking ideas from the wise minds of the internet. Any thoughts? ...

Tips for setting a checkbox as checked by default using AngularJS

I would like the checkbox to be checked by default. HTML : <div class="form-group col-sm-6" ng-class="{ 'has-error': pForm.caddress.$dirty && pForm.caddress.$error.required }"> <label class="contro ...