I have a search area on this website. The search button has a min width of 80 px which is coming from bootstrap. How can I remove/override the width?
5 Answers
you can remove btn
class
OR
you can override using its id selector and setting min-width to unset
min-width: unset;
in your example
input#searchsubmit {
min-width: unset;
}
Add .btn
selector in your custom CSS to override bootstrap css.
.btn {width: [n]px} /*set your desired width*/
Or
Add a new selector and set the width for that.
That's it.
-
And what if the OP wants to keep that style, but only wants to change it for only that one element?– VuckoCommented Sep 15, 2015 at 8:48
-
Add .btn class in your code and mark your width as important
.btn{
width : <your value> px !important
}
Add a custom class to the button with no min width.
If you only want to change this button and not the others.
Example:
no-min-width {
min-width: 0;
}
-
no-min-width is missing the dot, in your example. This is also the wrong way to do it. See @shaymmakawana.me's answer. Commented Aug 30, 2017 at 16:31
this will work 100%
input#searchsubmit {
min-width: inherit;
}
-
Its already inheriting from bootstrap so you're just telling it to do the same thing its doing... Commented Aug 30, 2017 at 16:28
.search_box_class_name { min-width: width_you_want!important; }
btn
class.