Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i use both bootstrap 3 and bootstrap 4 in same html file for different-different divs in a webpage .if yes how to do this

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>bootstrap3 &bootstrap4 in same html file</title>
  </head>
  <body>
    <div class="bootstrap3">
       some code here which require bootstrap3 css files
    </div>
    <div class="bootstrap4">
       some code here which requires bootstrap4 css files
    </div>
  </body>
</html>

i have problem in this section so please help me out to solve this

like image 301
Nitish Singh Avatar asked Mar 19 '18 13:03

Nitish Singh


People also ask

Is Bootstrap 4 backwards compatible with Bootstrap 3?

Bootstrap 4 is not backward compatible with Bootstrap 3.

What is difference in Bootstrap 3 and Bootstrap 4?

Bootstrap 3 has 4 tier grid system that includes xs, sm, md, and lg. Bootstrap 4 has 5 tier grid system that includes xs, sm, md, lg, and xl.

Can I use Bootstrap 4 and 5 together?

If you are using Bootstrap 4 or older version of Bootstrap framework, you may need to customize your support level when migrating to Bootstrap 5. Internet Explorer 10 and 11 has been officially dropped on the new version.

Should I use Bootstrap 3 or 4?

Bootstrap 3 used floats to handle the layout unlike flexbox in Bootstrap 4. The Flexible Box Layout makes it easier to design flexible responsive layout structure without using float or positioning. Although it has responsive features, with custom CSS the implementation has become complex with Bootstrap 4.


2 Answers

I believe the quick answer is No, for a number of reasons.

Note, While I believe you're talking about CSS, you don't exactly state whether you're talking about the CSS of bootstrap or the JS of bootstrap, or both.

Regardless, surely both bootstrap 3 and 4 both have styles and JS functions with the same names, and would surely conflict - or just be overwritten. (The last thing loaded usually overwrites the previous thing loaded).

Secondly, a little comment here about cooperation.
The team should standardize on what to use, not go in different directions on something like this. ("Too many chefs in the kitchen" comes to mind.) There should be a serious talk / debate (not argument ) about the pluses and minuses of which bootstrap to use. I acknowledge, that there are perfectly valid reasons not to use Bootstrap 4 (that's another story), but honestly - just because something is the latest thing, doesn't mean you HAVE to use it, and there are many more examples and "best practices" of Bootstrap 3 out there, at this point in time.
Regardless,I'd suggest that your team stay focused on solving the current problem at hand, IMHO.

like image 152
Logan Avatar answered Oct 10 '22 17:10

Logan


It's not possible to integrate both bootstrap3 and bootstrap 4 because of many classes of the bootstrap library with the same name.

like image 42
Luchifer Avatar answered Oct 10 '22 19:10

Luchifer