My app has been crashing on Safari (only) and I've narrowed it down to this one line:
<link href="https://fonts.googleapis.com/css?family=Quicksand:300,400,500,600,700&display=swap" rel="stylesheet">
This line causes no issue if I only load one weight, but once I add a second, Safari crashes again. In other words, the following works:
<link href="https://fonts.googleapis.com/css?family=Quicksand:300&display=swap" rel="stylesheet">
... this also works
<link href="https://fonts.googleapis.com/css?family=Quicksand:300&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Quicksand:400&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Quicksand:500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Quicksand:600&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Quicksand:700&display=swap" rel="stylesheet">
Any idea why this might happen?
Related
I am working on a simple dev in Google Apps Script. I also have html part. I can see in the browser console that there are issues related to link preload. Any recommendations or advisory on how to handle these errors? Details below:
Chrome console screen with the preload issues
My html head code:
<head>
<base target="_top">
<link rel="preconnect" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css" crossorigin="anonymous">
<link rel="preload" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css" as="style">
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css">
</head>
The problem is you preload your asset but don't use it, in order to load and use it add onload attribute to your link, or just use that asset like your third link by using rel="stylesheet" and remove as attribute
<head>
<base target="_top">
<link rel="preconnect" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css" crossorigin="anonymous">
<link rel="preload" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css">
</head>
I initially was loading a page
somePage
And the index.html would render with styling
<head>
..
<link rel="stylesheet" type="text/css" href="app/themes/basic_themes/blabla/base_theme/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="app/themes/defaults/generated.css">
<link rel="stylesheet" type="text/css" href="app/themes/basic_themes/blabla/generated.css">
<link rel="stylesheet" type="text/css" href="app/themes/brands/blabla/generated.css">
<script src="/js/libs/jquery.min.js"></script>
</head>
The above code works fine in production. However someone made some changes and deleted the app folder and refactored the code to this:
somePage
And the index.html to
<head>
..
<link rel="stylesheet" type="text/css" href="themes/basic_themes/blabla/base_theme/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="themes/defaults/generated.css">
<link rel="stylesheet" type="text/css" href="themes/basic_themes/blabla/generated.css">
<link rel="stylesheet" type="text/css" href="themes/brands/blabla/generated.css">
<script src="/js/libs/jquery.min.js"></script>
</head>
Now index.html cannot find the css styling. I tried different relative and absolute paths but nothing seems to work.
Any help?
EDIT: My folder structure is:
When I load my page localy http://localhost:56071/blabla/en/ and then click to navigate to "somePage" I end up on http://localhost:56071/tos/blabla/en/ a page with text and no styling. However, if I try to navigate to http://localhost:56071/themes/basic_themes/blabla/base_theme/bootstrap.min.css it returns a 404. BUT I can access my .css file through this link http://localhost:56071/blabla/en/themes/basic_themes/blabla/base_theme/bootstrap.min.css Can someone explain whats happening here?
I have multiple css files in html file. It cause conflict for some of the styles.
I want to know execution sequence to avoid conflict or suggest me some other method.
Below are the code.
<link rel="stylesheet" href="libs/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="libs/ionicons/css/ionicons.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/owl.carousel.css">
<link rel="stylesheet" href="css/owl.theme.css">
<link rel="stylesheet" href="css/nivo-lightbox/nivo-lightbox.css">
<link rel="stylesheet" href="css/nivo-lightbox/nivo-lightbox-theme.css">
<link rel="stylesheet" href="css/animate.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/cropper.min.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/fileinput.cs">
The CSS files will be parsed from top to bottom. For example, any conflicting styles in main.css would be overridden by style.css.
I would suggest using a CSS preprocessor like Sass and a task runner like Gulp to bundle your stylesheets together, reducing the number of requests the browser has to make. That would also make it easier to namespace any styles to avoid conflicts.
For example:
#namespace {
// original code goes here, which will all be prefixed with #namespace
}
FYI, there’s a typo in your code above—css/fileinput.cs is missing an s.
I have created a web page which has the following at the start,
<link href="./css/font-awesome.min.css" rel="stylesheet">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600" rel="stylesheet">
<link href="./css/ui-lightness/jquery-ui-1.10.0.custom.min.css" rel="stylesheet">
<link href="./css/base-admin-3.css" rel="stylesheet">
<link href="./css/base-admin-3-responsive.css" rel="stylesheet">
<link rel="stylesheet" href="./compiled/flipclock.css">
<link href="./css/pages/plans.css" rel="stylesheet">
<link href="./css/pages/pricing.css" rel="stylesheet">
<script src="./js/jquery-1.11.1.js"></script>
<script src="./compiled/flipclock.js"></script>
<link href="./css/custom.css" rel="stylesheet">
I have the page created statically and it looks perfect, however now I have started to integrate it with node.js and express. When loading the page from the app.js I am using.
app.get('/liveSale.html', function(req, res){
res.sendfile('liveSale.html');
});
However when the page is loaded it will not render the stylesheets and scripts.
Hope someone can help.
Looks like I found a couple of duplicate threads.
app.use(express.static(__dirname + '/public'));
This solved my problem.
I have a very new site I am trying to put together and it seems that my css file isn't being recognized.
The site is http://www.problemio.com and I have in my index.php a direction to pick up the css file like this:
<link rel="stylesheet" type="text/css" href="main.css"/>
and then a header div declaration like this where some of the initial styles are used:
<?php
include("divs/header.php");
?>
I am trying to go through the index.php file with firebug, but not sure how to tell if the css file is being recognized or something else is the problem.
Any ideas how to get the styles recognized?
You have to link to the CSS Reset before you link to your own styles.
The way you set it up now, the CSS Reset is resetting your styles.
Change this:
<link rel="stylesheet" type="text/css" href="main.css"/>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/reset/reset-min.css"></link>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/grids/grids-min.css"></link>
<link rel="stylesheet" type="text/css" href="menusystem.css"/>
to this:
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/reset/reset-min.css"></link>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/grids/grids-min.css"></link>
<link rel="stylesheet" type="text/css" href="menusystem.css"/>
<link rel="stylesheet" type="text/css" href="main.css"/>
Loaded CSS:
grids-min.css
main.css
menusystem.css
reset-min.css
Reset is loading after the others, which nullifies the majority of your settings.
This is probably because of the order you are loading the CSS files. You are loading your "main.css" file first, then the YUI reset CSS, which basically resets whatever your main.css file has set already. Try loading the reset first.
The stylesheet appears to be loading fine. You need to put it after the reset styles though, or the reset will get rid of most of yours.
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/reset/reset-min.css"></link>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/grids/grids-min.css"></link>
<link rel="stylesheet" type="text/css" href="main.css"/>
<link rel="stylesheet" type="text/css" href="menusystem.css"/>
If the problem you think you are seeing is related to the sign-in links, note that they are set to color:#fff;, which happens to match the background...
Depending on your browser, Ctrl+Shift+I (Chrome), Ctrl+Alt+I (Safari), F12 (IE9), or Firebug (Firefox) can show you which resources are loaded... You should probably get comfortable with the developer modes for each.