简体   繁体   中英

Override bootstrap style not working

I have this simple situation, I have an style with no defined display property value, I recently added bootstrap to my project with no major problems, just one.

In label bootstrap style is defined a display: inline-block; what I don't need and is causing some troubleshooting on my page. So simply I overwrite it, but it seems It's getting the bootstrap value. !important is not working also. As you can see in the image below: 在此处输入图片说明

Even, It's marked as overwritten on Developer Tools. I also tested removing the line from the bootstrap file and it works, but that's not viable option in my situation. I'm stuck here, as I said, no more problems with bootstrap, and haven't had this situation before.

I have to add that I'm setting right position for style sheets on my page.

EDIT:

I'll attach the result and the expected result, when I remove the bootstrap style. It seems to be working even It is overwritten.

Expected result when bootstrap style is removed (this apply to in time Developer tools and when removing from bootstrap.css) 在此处输入图片说明

PS: IE as needed browser.

EDIT2:

Problem solved, It was related to IE version, our company gives support to IE only on this application, and the problem was that some previous change was forcing IE to run compatibility on version 5, for reason that anyone knows, switched to IE as standards and it's working.

Thank you all any idea or comment.

问题与IE兼容模式有关。

This worked for me: My problem was the way I linked it.

example: lets say input tag inherited style from vendors file(say bootstrap), and say you are too far in the project and linking files the other way round screws up your layout then, create a new style sheet and link it after the bootstrap link.

<link rel="stylesheet" href="styleSheet.css">
<link rel="stylesheet" href="bootstrapStyles.css">
<link rel="stylesheet" href="newStyleSheet.css"> // write the style for elements that you don't want styles from bootstrap to be inherited and link it this way.

right way of doing:
<link rel="stylesheet" href="bootstrapStyles.css">
<link rel="stylesheet" href="styleSheet.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