Custom Font not displaying in my webpage - html

I have a particular set fonts that I want to implement on a web application that I am building for my class project. Right now, I have it all hosted on GitHub via GitHub Pages. The index page currently uses 4 CSS files, one for Animate.css, the general CSS file for the whole application, Bootstrap's CSS file, and then another CSS file specifically for it.
On the general web app CSS file, named custom.css, I have the following code:
#CHARSET "ISO-8859-1";
#type-face {
font-family: FuturaStd-HeavyOblique;
src: url('fonts/FUTURASTD-HEAVYOBLIQUE.OTF');
}
#
type-face {
font-family: COUTURE Bold;
src: url('fonts/COUTURE-Bold.ttf');
}
.body {
background-color: black;
color: white;
height: 100%;
}
And here is my index.css file:
body {
background-image: url('../images/flyknit.jpg');
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-attachment: fixed;
-webkit-background-size: cover;
}
.indexTitle {
font-family: FuturaStd-HeavyOblique;
text-align: center;
}
h1 {
font-size: 500%;
}
.buttonBox {
margin-top: 150px;
text-align: center;
font-family: FuturaStd-HeavyOblique;
}
#bbText {
text-align: center;
}
a {
color: white
}
At first, the fonts were running fine on my computer, because I have them installed. But if I was to run the page through GitHub, the font does not show up. And recently, the font won't even run from my own computer. What did I do wrong? Any help is appreciated.

How about you try this in your fonts.css
#font-face {
font-family: 'FuturaStd-HeavyOblique';
src: url('fonts/FUTURASTD-HEAVYOBLIQUE.OTF');
}
call it back with
font-family: 'FuturaStd-HeavyOblique';
Not sure if quotation marks matter, but I believe #type-face should be #font-face

Related

CSS background-image not showing up (sometimes)

I'm trying to set the background-image-property in CSS.
Here's my Code:
body{
background-color: #2C2F33 ;
background-image: url(https://i.postimg.cc/htbpRQ6f/0f73b4070e4238fe757656ba68e24c44af64c970.jpg);
background-size: cover;
background-attachment: fixed;
font-family: 'Roboto', 'Arial', 'sans-serif';
color:white;
}
Everything is working fine, but sometimes after starting Firefox, the Background-Image won't show up.
It will get loaded, if i'm using Strg+F5.
So the background-image isn't set properly in cache.
Does anyone know how to set it properly?
I shorted and update your code a little bit, It's worked on codepen every time. You could try it, Hope it will solve your problem.
The code:
body{
background: url("https://i.postimg.cc/htbpRQ6f/0f73b4070e4238fe757656ba68e24c44af64c970.jpg"), #2C2F33;
background-size: cover;
font-family: 'Roboto', 'Arial', 'sans-serif';
color:white;
}
Also see from code snippet:
body{
background: url("https://i.postimg.cc/htbpRQ6f/0f73b4070e4238fe757656ba68e24c44af64c970.jpg"), #2C2F33;
background-size: cover;
font-family: 'Roboto', 'Arial', 'sans-serif';
color:white;
}

Accessing the root directory to access a background-image?

I want to add a background image on my webpage but when I add in my code it doesn't show the image. The page is linked to the home page but how would I get my background image to appear when the user selects the help guide tab, which it then takes them to another page.
<html>
<head>
<meta charset="utf-8" />
<style>
h1 { text-align: center; font-family: "Comic Sans MS", "Comic Sans", cursive; font-size: 50; }
p.p-stage { text-align: center; font-family: Arial; font-size: 150%; }
p.p-help { text-align: center; font-family: Arial; font-size: 100%; }
body {
background-image: url("assets/images/Festival.jpg");
background-height: 100%;
backgroud-width: 100%;
background-repeat: no-repeat;
background-size: cover;
}
#rcorners2 {
margin: auto;
text-align:left;
border-radius: 25px;
border: 2px solid #000000;
padding: 20px;
width: 1000px;
height: 750px;
overflow: auto;
}
</style>
</head>
<body>
<h1>Help Guide</h1>
<p class ="p-stage" id="rcorners2">Stages:<br><br>1. How to add a stage?<br><br>
To create a stage please do this.................<br><br>
2. How to delete a stage?<br><br>
To delet a stage please do this.................<br><br>
3. Add a help guide with a questions users may come up with and then com up with answers.
</p>
</body>
</html>
Here is my webpage
I fixed the problem. it is due to path of the root directory. To go back in the root directory where the image file might be in use:
background: url("../../assets/images/Wallpaper4.jpg");
the 2 dots go back one folder so two .. means you have gone back 2 folders

Why won't my image transfer from my files into my stylesheet for a DIV?

I'm trying to replicate a webpage template solely for the purpose of becoming more familiar with the works of HTML/CSS. I want to use an image in my documents as a background for a DIV, but for some odd reason, it will not import. Keep in mind, I'm still pretty new to coding.
I pulled a random stock photo address off of Google as a test, and that would work. So, I'm thinking either I have the photo located in the wrong folder (It's in the same exact folder as the document I'm calling it from), or there's something else in my code that is conflicting with the called image/file. I'm still not sure, though.
HTML file:
<html>
<head>
<title>conquer</title>
<link rel="stylesheet" type="text/css" href="conquer.css" />
</head>
<body>
<div class="navbar">
Homepage
About Us
Services
Contact
External
</div>
<div class="topbanner"></div>
</body>
</html>
CSS file:
body {
background-color: #fff;
margin: 0;
}
/** Navigation Bar **/
.navbar {
background-color: #383E4C;
height: 100px;
width: 100%;
position: fixed;
text-align: center;
margin-top: 0px;
}
.navbar a {
color: #F6F6F7;
text-decoration: none;
font-size: 22px;
font-family: "Helvetica", sans-serif;
border: 1px solid #646D7C;
padding: 15px;
margin-top: 20px;
margin-right: 20px;
display:inline-block;
}
.navbar a:hover {
background-color: #49505F;
}
/** Top Banner **/
.topbanner {
height: 500px;
width: 300px;
background-image: url('/city.jpg');
background-repeat: no-repeat;
}
I want the image to display in the DIV, but when I open the console elements, it's just a huge invisible block.
In paths, the leading slash /, tells the browser to goto the ROOT folder.
So you will want to change this:
background-image: url('/city.jpg');
to
background-image: url('city.jpg');

CSS issue: absolute path not working for background image

In a simple static webpage project, I have the following in my main.css:
.navbar-custom {
background: rgb(52, 73, 94);
background: rgba(52, 73, 94, 0.7); /* navbar-bgcolor */
background-image: url(../../images/distant-lights.jpg);
background-size: cover;
/* background-image: url(https://jessicasse.files.wordpress.com/2012/10/distant-lights-1-1152x8641.jpg); */
position: relative;
top: 0;
left: 0;
width: 100%;
z-index: 3;
font-family: 'Lato', 'Open Sans', 'Helvetica Neue', Helvetica, Calibri, Arial, sans-serif; /* heading font */
}
And this works as intended. However, if I modify the background-image line and specify the absolute path /images/distant-lights.jpg, the image does not show up.
The project structure is as follows:
Even though the HTML+CSS works with the relative path, I would like to know why the absolute path fails. As you can see, I tried out absolute URLs with http, and that works just fine.
/images/distant-lights.jpg
This is not an absolute path. An absolute path starts from a system root directory. On a typical linux system it looks something like this:
/home/username/somefolder/someotherfolder/projectfolder/images/distant-lights.jpg

Background image will not render when hosted

I have built a landing page for an external client all is working fine, I have a background image which fits the hole screen, I modified the existing body tag within the bootstrap.css class as follows
body {
margin: 0;
background-image: url('/Content/Images/Danone-Background-New.png');
background-size: 1440px 800px;
background-repeat: no-repeat;
background-size: cover;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.428571429;
color: #333333;
background-color: #ffffff;
z-index: 9999;
}
Again this works perfectly when running locally, I then publish this site to the hosting environment, and when I navigate to the site all the content is displayed minus the background image, so I first assumed I have the wrong path so I checked the body style using firebug and this is what I see
body {
background-color: #fff;
color: #333;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 14px;
line-height: 1.42857;
}
So for first glance I assumed "Oh that's strange it hasn't copied over my body styles!" so I repeat the process again and low and behold the body style remains as above, So i login to the server navigate through the files to the bootstrap.css find the body tag and again it looks as I expected
body {
margin: 0;
background-image: url('/Content/Images/Danone-Background-New.png');
background-size: 1440px 800px;
background-repeat: no-repeat;
background-size: cover;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.428571429;
color: #333333;
background-color: #ffffff;
z-index: 9999;
}
Yet the image does not render.
What is wrong with this? I have tried ctrl f5, looked in the development tool bar checked for any 404 erros nothing displayed ? I'm baffled?!
Link to check www.danoneultimate.com.au
In the <head> section of your website, you load a different stylesheet.
<link href="/Content/css?v=WY2Ybti5pBJYm0QfqiFBL2b5U_cKoeAWQC9DALv4mnw1" rel="stylesheet">
Change it so that it loads bootstrap.css:
<link href="/Content/bootstrap.css" rel="stylesheet">
You have edited bootstrap.css but you're loading bootstrap.min.css.
Your code works just fine :)