how to add css links in others pages Without distortion? - css

I have a view for showing my products in it I've used rPage plugin for responsive pagination.but i have a problem with it.when I add bootstrap in top of page. all of element are being mess but rPage has good style.and vice versa when I remove bootstrap link rpage plugin is being mess. I add two images for better understanding.
these are css links in _AdminLayout.
<link href="~/content/materialpro/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- chartist CSS -->
<link href="~/content/materialpro/assets/plugins/chartist-js/dist/chartist.min.css" rel="stylesheet">
<link href="~/content/materialpro/assets/plugins/chartist-js/dist/chartist-init.css" rel="stylesheet">
<link href="~/content/materialpro/assets/plugins/chartist-plugin-tooltip-master/dist/chartist-plugin-tooltip.css" rel="stylesheet">
<link href="~/content/materialpro/assets/plugins/css-chart/css-chart.css" rel="stylesheet">
<!--This page css - Morris CSS -->
<link href="~/content/materialpro/assets/plugins/c3-master/c3.min.css" rel="stylesheet">
<!-- Vector CSS -->
<link href="~/content/materialpro/assets/plugins/vectormap/jquery-jvectormap-2.0.2.css" rel="stylesheet" />
<!-- Custom CSS -->
<link href="~/content/materialpro/css/style.css" rel="stylesheet">
<!-- You can change the theme colors from here -->
<link href="~/content/materialpro/css/colors/blue.css" id="theme" rel="stylesheet">

Currently rPage is for Bootstrap 3. It's not compatible with Bootstrap 4, and kind of obsolete since Bootstrap 4 has the same functionality's and rPage.

Related

custom.css loads with delay while bootstrap style shows for few seconds first

I created custom.css to overwrite my bootstrap. It works but for a few seconds, it shows default bootstrap style first, and then loads custom one. Any ideas? Thanks!
The custom css goes after bootstrap btw:
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'></script><script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/js/bootstrap.min.js'></script>
<link rel="stylesheet" href="https://toert.github.io/Isolated-Bootstrap/versions/4.0.0-beta/iso_bootstrap4.0.0min.css">
<link rel="stylesheet" type="text/css" href="css/custom.css">
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'></script><script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/js/bootstrap.min.js'></script>
<link rel="stylesheet" type="text/css" href="css/custom.css">
<link rel="stylesheet" href="https://toert.github.io/Isolated-Bootstrap/versions/4.0.0-beta/iso_bootstrap4.0.0min.css">
Try switching the places so that custom.css loads first ^^

uikit downloaded css isn't functional

I'm using CDNJS to access the uikit library. The CSS I download from their customizer, which allows you to create your own personal theme scheme, isn't functional. Below is how I linked to my CSS files, the path is correct because my portfolioStyle.css file is functional.
<head>
<meta charset="utf-8">
<title>Contact</title>
<!-- jQuery -->
<script src="https://code.jquery.com/jquery.js"></script>
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="assets/css/portfolioStyle.css">
<link rel="stylesheet" type="text/css" href="assets/css/uikit.css">
<!-- UIkit -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/css/uikit.min.css" />
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Caveat|Stoke" rel="stylesheet">

BOOTSTRAP CDN Hosted, additional CSS

I'm using BOOTSTRAP via the CDN hosted by MAXcdn. But now I want to change something in the CSS files, but it's not on my server.
So my question is, how to deal with additional CSS when you are embedding your files via a CDN solution?
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
Create a new file called custom.css and include it inside <head></head> after the CDN versions.
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
<!-- Your Custom theme -->
<link rel="stylesheet" href="your/path/to/custom/css/file">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
The best possible solution is overwriting CSS rules from bootstrap.css file into custom.css file.
for eg
If you include your css (custom.css) after Bootstrap's (bootstrap.css), you can override rules by redefining them.
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
<!-- Your Custom CSS code should go in this file-->
<link rel="stylesheet" href="css/custom.css">
tip: make sure to add your custom.css file after bootstrap CDN file into your HTML document.

Can't get bootstrap to apply to my code

I am trying to use bootstrap to style my page, and I have it linked with
<link href="css/bootstrap.min.css" rel="stylesheet"> which is what given on the website. But bootstrap won't apply when I run my code. I have them in the same folder.
Bootstrap should be the first css link in your head tag, after that the other css links. I don't really know what you mean with "I have them in the same folder." but I hope you mean that you have the bootstrap css files in your css folder.
Try putting it at the top like this:
<head>
<title>Title</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- General CSS -->
<link href="css/general.css" rel="stylesheet">
<!-- font awesome CSS link -->
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Javascript here -->
</head>
You can also try to use the bootstrap.css file. This will probably be the one you'll be editing as well.

How to use multiple CSS files in Meteor

I've started using meteor and want to know what is a good way to migrate a HTML file that refers to many CSS files. So far, I found that meteor will automatically load all CSS files in an alphabetic order. My two questions are as follows:
Where should I locate the CSS files? (or from where I can control which directories are loaded)
Is it possible to load specific CSS files in particular order?
Here are the current references I have in my HTML file, before migrating to meteor.
<!-- Web Fonts -->
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800|Shadows+Into+Light" rel="stylesheet" type="text/css">
<!-- Libs CSS -->
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/fonts/font-awesome/css/font-awesome.css">
<link rel="stylesheet" href="vendor/owl-carousel/owl.carousel.css" media="screen">
<link rel="stylesheet" href="vendor/owl-carousel/owl.theme.css" media="screen">
<link rel="stylesheet" href="vendor/magnific-popup/magnific-popup.css" media="screen">
<!-- Theme CSS -->
<link rel="stylesheet" href="css/theme.css">
<link rel="stylesheet" href="css/theme-elements.css">
<link rel="stylesheet" href="css/theme-animate.css">
<!-- Current Page Styles -->
<link rel="stylesheet" href="vendor/rs-plugin/css/settings.css" media="screen">
<link rel="stylesheet" href="vendor/circle-flip-slideshow/css/component.css" media="screen">
<!-- Skin CSS -->
<link rel="stylesheet" href="css/skins/blue.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="css/custom.css">
<!-- Responsive CSS -->
<link rel="stylesheet" href="css/theme-responsive.css" />
Thank you for your help! :)
There is no need to provide reference of stylesheets in meteor. Just put your css file in client/stylesheets folder. Meteor will automatically apply these css rules.
As stated by #imslavko you can find Meteor behaviour at https://guide.meteor.com/structure.html
However these rules are more relevant for .js code and .htmltemplate files: Meteor merge and minimize all .css in a single file (as long as they are provided by you and not on a CDN) so you will find a single <link rel="stylesheet"> reference in your <head>.
Remember to put all frontend files inside client folder, to avoid unnecessary server loading and availability.
So you can choose your convenient folder structure for .css files, for example put them all in client/stylesheets or use other subfolders to better manage them.

Resources