In most situations, what will occur is the element taking the style of the version of Bootstrap
which was last included, as in the 2 examples below:
Version 4
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.bundle.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<button class="btn btn-primary">Botão Bootstrap 4</button>
Version 3
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.bundle.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<button class="btn btn-primary">Botão com Bootstrap 3</button>
Now, in some elements, there may be conflict, as in the example below, where the down arrow of the dropdown ends up getting out of position using a .btn-group
and .dropdown
:
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.bundle.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="btn-group" role="group" aria-label="...">
<div class="btn-group" role="group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown com conflito
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#">Dropdown 1</a></li>
<li><a href="#">Dropdown 2</a></li>
</ul>
</div>
</div>
Completion
In addition to style conflicts, there may be conflicts between JS of the two versions, unless you divide your application into two different blocks for each version of Bootstrap
no As it is a good idea to keep both in the same project, I recommend migrating from the old version to the v4, or use the v3 in that new part.
OBS:
Testing done in Chrome Win 10.
I don’t think it’s a good idea, there will surely be conflicts
– AnthraxisBR
@Anthraxisbr, so in your opinion is a mistake?
– Maria Canelas
I’ll give you an answer to show you what can happen
– AnthraxisBR
Here is the official Migration Guide https://getbootstrap.com/docs/4.0/migration/ another very basic point is that the Grid of one version is very different from the other! Even responsive "Break Points" have different measures for each other.
– hugocsl