简体   繁体   中英

Why bootstrap override internal style?

This is my Head tag in a html page

<head>
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <style>
        input[type=text] {
            font-size: 18px;
            height: auto;
        }
        select {
            font-size: 18px;
            height: auto;
        }
    </style>
</head>

bootstrap override my inline style for select element, What is the reason?

引导程序中的规则.form-control比您的input更重要,只需使用.form-control并添加新样式

in bootstrap select styled with other elements like input,textarea etc.

The .form-control class name more specific and takes precedence then select element that's why its better to use .form-control class to override bootstrap default style.

Use .form-control instead of select element.Add this class to your CSS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM