Using material ui in html development? - html

I want to know how I can use Material UI in my html project. I want know whether I can implement code from material UI's git page

From what I have understood and read from the web and your question is that no, unfortunately it is mainly based for javascript and it's frameworks and so on. You could, which I am assuming is not what you would want to do, is you could incorporate react within your html by plugging a cdn then writing your react code in another script tag. But, I have found a possible solution, even though it isn't Material UI, it's somewhat close:
https://getmdl.io/
This is material design light. For example, to create a button just add the cdn and style sources:
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
Then add your button like so:
<!-- Accent-colored raised button with ripple -->
<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">
Button
</button>
<!-- Colored FAB button -->
<button class="mdl-button mdl-js-button mdl-button--fab mdl-button--colored">
<i class="material-icons">add</i>
</button>
Hope this helps.
Sorry for the almost 4 year delay.

Copy-paste the stylesheet into your before all other stylesheets to load our CSS.
<link rel="stylesheet" href="https://unpkg.com/bootstrap-material-design#4.1.1/dist/css/bootstrap-material-design.min.css" integrity="sha384-wXznGJNEXNG1NFsbm0ugrLFMQPWswR3lds2VeinahP8N0zJw9VWSopbjv2x7WCvX" crossorigin="anonymous">
Many of our components require the use of JavaScript to function. Specifically, they require jQuery, Popper.js, and our own JavaScript plugins. Place the following s near the end of your pages, right before the closing tag, to enable them. jQuery must come first, then Popper.js, and then our JavaScript plugins.
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://unpkg.com/popper.js#1.12.6/dist/umd/popper.js" integrity="sha384-fA23ZRQ3G/J53mElWqVJEGJzU0sTs+SvzG8fXVWP+kJQ1lwFAOkcUOysnlKJC33U" crossorigin="anonymous"></script>
<script src="https://unpkg.com/bootstrap-material-design#4.1.1/dist/js/bootstrap-material-design.js" integrity="sha384-CauSuKpEqAFajSpkdjv3z9t8E7RlpJ1UP0lKM/+NdtSarroVKu069AlsRPKkFBz9" crossorigin="anonymous"></script>
<script>$(document).ready(function() { $('body').bootstrapMaterialDesign(); });</script>

First you need to install Material ui using NPM
npm install
Install with Bower
You can also install and manage Material Bootstrap using Bower
bower install bootstrap-material-design
here is link for instruction giving how to use material ui in html
https://fezvrasta.github.io/bootstrap-material-design/#getting-started
you will need to add
material.css and ripple.css file
for js file
material.js
material.min.js and ripples.min.js

Related

Bootstrap css is not working when using carousel

So basically it looks like my carousel does not have any styling whatsoever. I copied the exact code from ng-bootstrap carousel example but mine looks like this when running.
This is ngbootstraps
result.
Steps I did before:
I installed #ng-bootstrap/ng-bootstrap, then I added bootsrap to my css and after that I imported ngModule and added it to my modules.
Any ideas why this does not work?
So, in my opinion, you added bootstrap incorrectly. When you are implementing bootstrap 5 to your html besides adding this in :
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
You also have to add this right before body closing tag:
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
This script basically makes interactive elements possible without using js. Here is a link to doccumentation if you want to learn more:
https://getbootstrap.com/docs/5.2/getting-started/introduction/
Lemme know if this helped

Bootstrap carousel not working locally, but works with online link

So I am working on a website for a school project and am using bootstrap. I downloaded bootstrap js e css files so I could use locally, so even if I don't have internet connection bootstrap would still work.
Everything was working fine, no problem with bootstrap, until I used a carousel.For some reason, my carousel wouldn't work, only the first image would appear. It didn't matter what i changed, nothing would work.
Then I tried changing the bootstrap files to the online links on the bootstrap website, and to my surprise, the carousel started working!
So why does the carousel only work with online bootstrap link and not local bootstrap files?
Below are the bootstrap files, locally and the web link. I am not providing the carousel html code because that is not the problem, seeing as i took it from the bootstrap website, and it is working, just not locally.
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<!--<link href="css/style.css" rel="stylesheet" type="text/css">-->
<!-- Boostrap Minified CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Plugin jQuery -->
<!--<script src="js/jquery-3.4.1.slim.min"></script>-->
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<!-- Bootstrap JavaScript -->
<!--<script src="js/bootstrap.min.js"></script>-->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
If anyone has had the same problem and nows how to solve it, i would apreciate it!
Thank you!
I suspect your calls failed because you did not call bootstrap.bundle.min.js (w/ Popper.js). You called the unbundled version (bootstrap.min.js) which does not include popper.js.
This is discussed in https://getbootstrap.com/docs/4.4/getting-started/contents/#css-files

How to upgrade bootstrap code for website to higher version?

I have my website's html code written by following bootstrap 3.3.6 claases. Now I want to use the features of bootstrap 3.3.7 but it's not straight forward to just change the version of the bootstrap. What's the best way to do this upgrade? Do I need to write all the code again following bootstrap 3.3.7 standards?
the best upgrade to a new version is removes the url of old version and add the new url of a new version . for more help go to NPM documentation https://docs.npmjs.com/cli/update
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!--add your css file here -->
<!--you must add the jQuery library here before the url of bootstrap/3.3.7/js/bootstrap.min.js-->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>

How to get calender icon to display using Twitter bootsrap 3

I am trying to implement a date time picker in my C# MVC view, but the calender icon to the right of my input box doesn't appear.
I am following the example from here.
Part of my view
<script src="/Scripts/angular-0.10.0.min.js"></script>
<link rel="stylesheet" type="text/css" href="/Content/bootstrap/css/bootstrap.min.css" >
<link rel="stylesheet" type="text/css" href="/Content/bootstrap/css/bootstrap-responsive.min.css" >
<script src="/Scripts/jquery-lib/jquery-1.10.2.min.js"></script>
<script src="/Content/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js">
</script>
<script data-main="/Scripts/main" src="~/Scripts/require.min.js"></script>
<div id="datetimepicker2" class="input-append">
<input data-format="MM/dd/yyyy HH:mm:ss PP" type="text"/>
<span class="add-on">
<i data-time-icon="icon-time" data-date-icon="icon-calendar">
</i>
</span>
</div>
I have tried explicitly stating the path of the glyphicons icon like the following which did not work:
#iconSpritePath: "/Content/bootsrap/img/glyphicons-halflings.png";
I end up getting this error:
The name 'iconSpritePath' does not exist
I also noticed that my Twitter bootsrap 3 class does not include the icon-calender class.
How to make calender icon appear?
From the official bootstrap documentation:
With the launch of Bootstrap 3, icons have been moved to a separate repository. This keeps the primary project as lean as possible, makes it easier for folks to swap icon libraries, and makes Glyphicons icon fonts more readily available to more people outside Bootstrap.
This is how you use it. The instructions are here: http://glyphicons.getbootstrap.com/
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0-rc2/css/bootstrap-glyphicons.css" rel="stylesheet">
<span class="glyphicon glyphicon-calendar"></span>

How to use only one element from twitter bootstrap?

How to use this ( https://github.com/silviomoreto/bootstrap-select ) twitter bootstrap plugin only for one element on the page? If I use it all my site use twitter bootstrap element (url are blue etc.)
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script type="text/javascript" src="bootstrap-select.js"></script>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="bootstrap-select.css">
<script type="text/javascript">
$(window).on('load', function () {
$('.selectpicker').selectpicker({
'selectedText': 'cat'
});
});
</script>
From your comment you are including:
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combi‌​ned.min.css" rel="stylesheet">
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"‌​>
On your site. This means you're including the whole of twitter bootstrap which adds some styles to normal html elements.
Instead of this, why not download just the files you linked to on github and use those instead, i.e. (if you host them yourself):
<link href="path/to/bootstrap-select.min.css" rel="stylesheet">
<script src="path/to/js/bootstrap-select.min.js"‌​>
If you needed other features from bootstrap you could also create a custom build using this resource.
In that case, you have two solutions.
Take the .less sources from github and rebuild bootstrap with only the things you need. In other words you'll have to remove most .less files from the build process and take only the things you need.
Since you only have one element, add the selector to a page with bootstrap and extract all the css related to this element. Put this css in a different file and link it in your html. Once you copied all the required css declarations everything should look as expected.
You can then rename classes if needed.
To copy css declaration used in the browser you can use dev toolbars from firefox/chrome and so on. There might be good plugins that makes the job easier.