[英]Two CSS style sheets change input tag
我目前正在嘗試將引導程序標簽合並到我的網站中。 我已經從Github bootstrap-tags下載了源代碼,它帶有自己的CSS樣式表。 在我當前的網站上,我有一個樣式表,可將屬性添加到HTML <input>
標記。 Github源代碼隨附的CSS還將屬性添加到HTML <input>
標記中,這兩種沖突的樣式返回了意外的結果。
所以有兩個樣式表
main.css
bootstrap-tags.css
我有三個輸入
<div class="row">
<div class="col-sm-6">
<input type="text" name="name" class="form-control" placeholder="Name (Required)">
</div><!-- /.col -->
</div><!-- /.row -->
<div class="row">
<div class="col-sm-6">
<input type="email" name="email" class="form-control" placeholder="Email (Required)">
</div><!-- /.col -->
</div><!-- /.row -->
<div class="row">
<div class="col-sm-6">
<input type="text" name="subjects" class="form-control" data-role="tagsinput">
</div><!-- /.col -->
</div><!-- /.row -->
我希望前兩個<input>
標記受main.css
影響,最后一個<input>
標記受bootstrap-tags.css
。 我該如何實現?
我知道我可以將類添加到輸入中,而不能將CSS直接添加到<input>
標記中,但是我想將直接CSS保留到<input>
標記中。
我如何解決問題
從技術上講這不是答案,因為它不能解決實際問題。
根據我所知道的和所研究的內容,元素無法確定從哪個樣式表接收其屬性。 因此,我被迫創建一個CSS類,並賦予每個屬性!important
標記以覆蓋<input>
標記的CSS。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.