In IE 11, Bootstrap 4 does not properly display the placeholder and typed text for input type text with padding

For my bootstrap 4 web page implementation, I needed to create a user input form. While the built-in bootstrap input types functioned well, customizing the text input type caused issues in Internet Explorer 11. The typed text and placeholder didn't display properly, although it worked perfectly on other browsers and even in IE when the padding property was removed. Here's the code snippet that caused the problem:

The resulting output:

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

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" />

<style>
.form-control-user {
  border-radius: 10rem;
  padding: 1.5rem 1rem;
}
</style>
<input type="text" class="form-control form-control-user" name="name" placeholder="E-mail" value="">

Answer №1

One issue arises due to the padding style and the use of the rem unit. The placeholder disappears, and input values are not visible when using the IE browser.

To address this problem, consider implementing the following code to apply a specific style for IE or utilize the px unit instead of rem.

<style>
    .form-control-user {
        border-radius: 10rem;
        padding: 1.5rem 1rem;
    }
    @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
        /* CSS for IE10+ */
        .form-control-user { 
            border-radius: 10rem;
            padding: 2px 1rem;
        }
    }
</style>

Alternatively,

<style>
    .form-control-user {
        border-radius: 10rem;
        padding: 2px 1rem;
    }
</style>

The displayed result in the IE browser will look like this:

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

Additionally, you can adjust the height property as shown below:

.form-control-user {
    height: 4rem;
    border-radius: 10rem;
    padding: 1.5rem 1rem;
} 

The output will appear as follows:

https://i.sstatic.net/9eWxQ.png

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 way to use jQuery to add items to my unordered list based on user

Here is the HTML code I have created: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name=& ...

Converting Windows paths to Unix paths using PHP

Currently, I am facing an issue with hosting a PHP website that was developed on a Mac on IIS. The problem arises when trying to display images uploaded through a form. The paths of these images are saved in Windows style format (i.e. \images\foo ...

Creating a multi-column layout with HTML and CSS

I'm currently exploring the most effective method to design this concept: https://i.stack.imgur.com/SOQp4.png The black square symbolizes small icons, accompanied by a heading and paragraph for each specific section. The icons need to align with the ...

Ways to Adjust the Earth's Position in WebGL Earth

I have been working with this WebGL Earth component for my project, but I am facing difficulty in adjusting the position of the planet on the canvas. My intention was to place the planet at the bottom of the page, but I haven't been able to achieve th ...

What are the steps to incorporating the League Gothic font into my website design?

Is there a way to incorporate League Gothic font into my website design? Visit the League Gothic GitHub repository Appreciate any guidance on this matter, ...

How can I loop through child elements in a table of contents using Pandoc?

Currently, I'm trying to create a unique Pandoc template that utilizes scrollspy for the Table of Contents (TOC) elements. Unfortunately, I am struggling to find a way to loop through the TOC child elements in order to apply custom styling. Is it feas ...

Hover-over functionality not functioning properly on select images

My website, located at , is fully functional. When you visit the homepage, you will see some words that turn black when you hover over them. I recently switched this site, which was originally created in Dreamweaver, to Umbraco, a .net based CMS. My site ...

Guide to using images as checkboxes in an HTML form

I want to design a form that allows users to select options by clicking on images instead of using checkboxes. The selected images should have a border around them to indicate they have been chosen. What type of input element can achieve this functionali ...

Exploring Angular Material Design's method for vertically populating a column

Is there a way to fill a column vertically in my current app? https://i.sstatic.net/uu4yO.png I've been struggling for hours trying to make the vertical items span the entire height of the page. I have pored over documentation and other posts, but I ...

Creating an Angular Js Application that offers two distinct user interfaces

I'm faced with a challenge in my work on a large AngularJS application that consists of multiple modules. The issue is that I now need to integrate a static website into this application, and the website has a completely different layout compared to m ...

Nothing is showing up on the React-bootstrap application

I am currently working on creating a Navbar using react-bootstrap, but my app is not rendering anything at all. The Navbar is placed in a separate component and I also have some CSS styling in a separate file. However, the only thing displaying in the app ...

The jQuery .focus() function is not functioning correctly on Android devices

I'm currently creating a mobile website for Android where I am using a select list as a menu. The select list is positioned off-screen, and I want to toggle the popup with the options in the browser by clicking on a div element. Despite multiple att ...

Parsing HTML using JavaCC

Recently, I've embarked on a journey with javacc and have been tasked with enhancing a basic html parsing using javacc code. My inquiry pertains to the <script> tags which contain numerous characters - like > and < that hold different mean ...

Validating Phone Numbers in HTML

Seeking assistance from HTML experts - I need to validate a phone number that includes only the plus sign and numeric values, with a maximum of 13 digits. Also looking for guidance on validating an email address with an "@" symbol and a "." without using ...

How to convert JavaScript RegExp hashtags into links in an HTML document without the hyperlinked hashtag

I need help replacing the text #hashtag with <a href="http://example.com/foo=hashtag"> #hashtag</a> using JavaScript or jQuery. This is what I have tried so far: <!DOCTYPE html> <html> <body> <button onclick="myFunction() ...

Creating a personalized validation function for an HTML 5 element

Creating form validation for a custom image selection tool based on html 5 form validation is my goal. The form includes the following elements: <form class="cms-form" action=""> <table width="800"> <tr> <td w ...

Is there a way for me to include a transition in the text of the picture's caption?

I've been attempting to incorporate a transition:1s; and transition the text to color:#0000. The specific text I'm working with is 'Joe Doe' in the image caption below my image. I've experimented with various placements in my CSS, ...

Dynamic CSS overlay based on database field content without requiring user interaction

Is there a way to automatically display overlays for specific options in a database field using Bootstrap code? The options are SOLD, CONTRACT, and NO. I need different overlays to appear for SOLD and CONTRACT, while no overlay is needed for the NO option ...

Obtain the row ID from a database by selecting checkboxes

I am facing a challenge when trying to remove a row from my MS Access database using checkboxes on my JSP page. Each row in the displayed database has a checkbox, but I am struggling to retrieve the rowId and link each checkbox with its respective row. Any ...

Positioning the dropdown under the search input in Ngbootstrap

Currently, I am referencing this specific documentation as I am interested in constructing a search bar similar to Gmail's layout. The search bar will consist of an input field along with a dropdown button that will display filter options. Regrettabl ...