Where is the btn-default gone in bootstrap 4

北慕城南 提交于 2019-12-19 16:36:39

问题


according to the bs3 to bs4 migration docs:

Buttons

Renamed .btn-default to .btn-secondary.

But the secondary does not look at all as the old default button.

I mean the white shaded button/dropdown etc...

When I do btn-light that is not the original btn-default.

So how do I get my default theme back for buttons/dropdowns etc... ?

AFAIR literally now... there was a correct default button in the bs4 but it was in a former alpha version. I guess thats true.


回答1:


The btn-outline-secondary class in Bootstrap 4 generates the closest to what used to be btn-default in Bootstrap 3.

That seems to be "typo" there in the docs.

primary is the blue button/color and secondary is the grey ones.

And the very light grey is btn-light.

Here's the reference link for Bootstrap 4 buttons:

https://getbootstrap.com/docs/4.0/components/buttons/




回答2:


add this css to your stylesheet file problem gone

.btn-default {
    color: #333;
    background-color: #fff;
    border-color: #ccc;
}
.btn-default:focus {
    color: #333;
    background-color: #e6e6e6;
    border-color: #8c8c8c;
}
.btn-default:hover {
    color: #333;
    background-color: #e6e6e6;
    border-color: #adadad;
}
.btn-default:active {
    color: #333;
    background-color: #e6e6e6;
    border-color: #adadad;
}


来源:https://stackoverflow.com/questions/49202887/where-is-the-btn-default-gone-in-bootstrap-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!