Reputation: 300
I'm reading sourcecode of html files that has something like:
link rel='stylesheet' type="text/css" href="https://<internet-link.../abc.css" />
This website is completely local - run without internet, does this mean some part of this file would not run as expected because its style need to fetch from internet?
Upvotes: 0
Views: 615
Reputation: 36
Yes, without internet no style will be applied. To fix this, you can initially include your online CSS file link and also use a local fallback. If the online file is not found or there is no internet connection, it will include the local one. For example:
<script>
(function($) {
$(function() {
if ($('body').css('color') !== '#000') {
$('head').prepend('<link rel="stylesheet" href="/css/abc.css">');
}
});
})(window.jQuery);</script>
This checks if CSS from your online file was applied to your page and if not, it loads the local CSS file.
Upvotes: 2