I just installed Centos 7.0 which comes with Apache 2.4. My bootstrap applications are not rendering properly. To be specific, the bootstrap components are not rendering correctly. For example, on button with class=btn-primary, where the color is blue and the text is white, the text gets rendered black with Apache 2.4. There are many other issues.
My question is has anyone else had this problem? Is there a work-around such as a backwards-compatibility flag for html tags? I Googled and could not find any other references.
Thanks for sharing any findings you may have.
These are the possible reasons: You have a wrong or incorrect link to the bootstrap file. browser caching and history is messing with your html. Other CSS files are overriding the bootstrap file.
We can check Bootstrap-specific method is available or not. Syntax: var bootstrap = (typeof $(). "Bootstrap-specific method" == 'function');
Another way of importing Bootstrap to HTML is to directly download the files locally to your HTML project folder. The files can be downloaded from the following links: Bootstrap 4: https://getbootstrap.com/docs/4.3/getting-started/download/ Bootstrap 5: https://v5.getbootstrap.com/docs/5.0/getting-started/download/
We had the same problem. It took us 5-6hrs to debug. It was an alias mapping bootstrap.css in the welcome.conf in /etc/httpd/conf.d/ directory
Alias /.noindex.html /usr/share/httpd/noindex/index.html
Alias /css/bootstrap.min.css /usr/share/httpd/noindex/css/bootstrap.min.css
Alias /css/open-sans.css /usr/share/httpd/noindex/css/open-sans.css
Alias /images/apache_pb.gif /usr/share/httpd/noindex/images/apache_pb.gif
Alias /images/poweredby.png /usr/share/httpd/noindex/images/poweredby.png
Just remove/comment out all the /css/ lines or disable to the welcome.conf. I don't know whether this comes with just CentOS or httpd package. It was a stupid thing to do.
Same thing happened to us with /error/ alias as well.
I found the problem. The bootstrap.min.css file is not compatible with APache 2.4. I have no idea why but when I switched to the non-minified version, everything worked properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With