Here are a couple of options you can consider:
1) Remove the "form-control"
class from the input field and replace it with your own custom class. You can then define the width of the input field using CSS.
HTML
<input type="text" class="custom-input" />
CSS
.custom-input {
width: 150px; // or any other desired width
}
2) Override the default CSS style of the element within a media query.
In Bootstrap's CSS, there might be a selector for "form-control" inside a media query that sets a specific width for the input field. You can create your own media query and selector to override this style.
3) Another option is to use both approaches mentioned above. Add a custom class to the input field like this:
<input type="text" class="form-control custom-input" />
Then adjust the width of the input field based on screen size using CSS.
If necessary, you can also apply !important
to the width property to prevent it from being overridden by other styles when the screen size changes.
For instance:
.custom-input {
width: 150px !important; // although not recommended, it can be effective
}