Bootstrap 3 conflicts
See original GitHub issueHi,
Thanks for the project, very cool!
I used it in combination with Bootstrap 3, and had to add the following CSS rules to get it to show correctly:
pre, code {
background: #f8f8ff;
font-family: monospace;
}
The background color here is not really important (it’s the github theme), the thing is bootstrap applies a background to the <pre>
and highlight.js to the <code>
, so we can see a bit of the <pre>
and its different background color.
I didn’t do a pull request because maybe that has already been discussed.
Issue Analytics
- State:
- Created 10 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Resolve the conflict between Bootstrap 3 and PrototypeJS
Opposite to the older Twitter Bootstrap 2, some of these components are incompatible with the Prototype Javascript framework.
Read more >Application using bootstrap 3 and 4 together has conflicts
I have an App that uses bootstrap 3 and 4. Its a pretty massive application and built on combination of angular 1 and...
Read more >Bootstrap 3 conflict! - concrete5
Hello, I'm using bootstrap 3 on my custom theme and everything is working fine, except whenever I'm in the edit mode, when I...
Read more >Conflict with bootstrap 3 #742 - mleibman/SlickGrid - GitHub
With bootstrap.css, something on cell/header size calculating is wrong. So the cells of the same column of different rows are not aligned ...
Read more >JavaScript - Bootstrap
No conflict Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. In these circumstances, namespace collisions can occasionally occur. ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi,
First, a thing to note: in a recent change we now apply the ‘hljs’ class to the container holding the code and all our stylesheets now refer to
.hljs
rather thanpre code
.Anyway, since we try not to tie highlighting to any particular container markup, it is expected that you might need some “integration” styling to have code blocks look nice in your site’s stylesheet. From the point of view of a highlighting library we just can’t know which pre-existing rules to take into account.
Does that make sense? (My English feels awkward today 😃 )
But this way we’re back to the problem that started the thread 😃
To sum this up, we’re aware of the problem that a site style setting a background to
<pre>
may not work beautifully out of the box with highlight.js. We don’t have an immediate solution for this without causing other regressions, so for now we consider writing a bit of glue code in CSS a recommended workaround.Closing the issue until a better solution comes up.