Reputation:
I have a webpage for a text-shadow generator.I am using the Bootstrap template. I am also using a custom font. This page is not online just local files. When I use Chrome the custom font will be applied but, in Firefox it won't except it if I upload the page to my website. I use linux for development but the same thing happened when I tried Firefox for Android Beta. Why is this happening?
Here is the image from Firefox:
And here is how it looks on Chrome or on Firefox when it is uploaded:
Here is my code: HTML:
<!DOCTYPE html>
<html>
<head>
<title>CSS3 Text Shadow Generator</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<META NAME="author" CONTENT="kounelios13">
<META NAME="subject" CONTENT="programming">
<META NAME="Description" CONTENT="Create text with drop shadows (also known as text-shadow) ">
<META NAME="Classification" CONTENT="No javascript is needed just pure CSS3">
<META NAME="Keywords" CONTENT="programming,web design,tools,generator">
<META NAME="Designer" CONTENT="kounelios13">
<META NAME="distribution" CONTENT="Global">
<META NAME="country" CONTENT="Greece">
<link rel="stylesheet" type="text/css" href="../../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../../css/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="../../css/general.css">
<link rel="stylesheet" type="text/css" href="../../css/navbar-head.css">
<link rel="stylesheet" type="text/css" href="../../css/apps/textshadow.css">
<link rel="stylesheet" type="text/css" href="../../css/apps/sliders.css">
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="../../js/bootstrap.js" type="text/javascript"></script>
<script src="../../js/prefixfree.js" type="text/javascript"></script>
<script src="../../js/apps/textshadow.js" type="text/javascript"></script>
</head>
<body class="bg-danger">
<?php include '../menu.php'; ?>
<div class="container">
<div class="jumbotron landing">
<h1>Text Shadow Generator v1.0 BETA </h1>
</div>
<h1 class="btn btn-info center-block text-center " id="generators">An easy to use text shadow generator</h1>
You can try your own values in the following form:
<div class="container">
<input type="text" id="boxShadowf"><div class="btn btn-success" id="boxSub">Get val</div>
</div>
<div class="row text-center">
<div class="col-md-4">
<span class="h3">X-axis</span>
<input type="range" class="slider form-control" id="x" step="0.1" min="-10" max="10" value="0">
</div>
<div class="col-md-4">
<span class="h3">Y-axis</span>
<input type="range" class="slider form-control" id="y" step="0.1" min="-10" max="10" value="0">
</div>
<div class="col-md-4">
<span class="h3">Blur</span>
<input type="range" class="slider form-control" id="blur" step="0.1" min="0" max="10" value="0">
</div>
<span class="h2 text-info" id="text-shadow" contenteditable>All the transformations will be applied here</span>
</div>
<div class="row text-center h3">
<div class="col-md-4 text-danger">
Red
<input type="range" class="slider rgb" id="red" step="1" min="0" max="255" value="0" style="background:red;">
</div>
<div class="col-md-4 text-success">
Green
<input type="range" class="slider rgb" id="green" step="1" min="0" max="255" value="0" style="background:green;">
</div>
<div class="col-md-4 text-primary">
Blue
<input type="range" class="slider rgb" id="blue" step="1" min="0" max="255" value="0" style="background:blue;">
</div>
</div>
<div class="btn btn-warning" id="toggleCode">
Toggle code
</div>
<div class="btn btn-danger" id="resetCode">Reset code</div>
<h1>Code</h1>
<div class="code bg-primary text-info " id="code">
div{
<p class="text-success bg-info"><span class="standard coded">
text-shadow:<span class="h-shadow Code">0px</span> <span class="v-shadow Code">0px</span> <span class="blur Code">0px</span> <span class="color"> black</span></span>
;</p>
}
</div>
<div class="btn btn-danger btn-block" id="optimize" >Optimize code</div>
</div>
</div>
</body>
</html>
And my css:
@font-face {
font-family: '3dumbregular';
src: url('../../fonts/3dumb/3dumb-webfont.eot');
src: url('../../fonts/3dumb/3dumb-webfont.eot?#iefix') format('embedded-opentype'),
url('../../fonts/3dumb/3dumb-webfont.woff') format('woff'),
url('../../fonts/3dumb/3dumb-webfont.ttf') format('truetype'),
url('../../fonts/3dumb/3dumb-webfont.svg#3dumbregular') format('svg');
font-weight: normal;
font-style: normal;
}
/*body{background:#99afaa;}
*/
div.landing{
font-family: '3dumbregular';
text-align: center;
background: dodgerblue;
}
.landing h1{
font-style: italic;
color: red;
}
.generator{
margin: auto;
margin-top: 5em;
height: 15em;
width: 15em;
background: orange;
border:4px dashed gold;
border-radius: 8px;
}
.slider{
background: #aa9df9;
}
.slider:nth-child(1){
padding-left: 0px;
}
.inset{
display: none;
}
/* Bρες το .row που ειναι κατευθειαν μετα απο μια ετικετα h1 */
h1 ~.row{
margin-top: 0.4em;
}
#boxShadowf,#boxSub{
height: 30px;
}
#boxSub{
padding: 3px;
margin-left: 3px;
margin-bottom: 1px;
}
#inset{
margin-top: 0.2em;
margin-bottom: 0.2em;
width: 10%;
}
#code{
padding: 4px;
}
Upvotes: 2
Views: 574
Reputation:
Firefox comes with a very strict "file uri origin" (file:///) policy by default: to have it to behave just as other browsers, go to about:config, filter by fileuri and toggle the following preference:
security.fileuri.strict_origin_policy
Set it to false and you should be able to load local font resources across different path levels.
Upvotes: 2