I am struggling with a problem that I cannot solve or understand. I have a form with one text input and one select drop-down. I am using Bootstrap 5, and I want to reduce the default left padding in all form controls. Therefore I have added a padding-left:0.3rem in my style definitions. Here's my example code:
.form-control,
.form-select {
padding-left: 0.3rem;
}
<head>
<title>Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<div class="container">
<form style="width:200px">
<label for="name" class="form-label">Name:</label>
<input type="text" class="form-control" id="name" name="name" value="John">
<label for="country" class="form-label">Country:</label>
<select class="form-select" id="country" name="country">
<option>USA</option>
<option>South Africa</option>
<option>Sweden</option>
<option>Netherlands</option>
</select>
</form>
</div>
</body>
I expect a result where "John" and "USA" is aligned with same padding in their form controls. But take a look at the image below. "USA" is padded more than "John". Why is that, and how can I solve it?
UPDATE: After testing this on different browsers I have learned that the problem only appears for Firefox. On Chrome and Edge the padding/alignment seems to be correct. So, now I wonder if I can use some CSS-trick to make it work on Firefox as well?
