I have a website template which uses flaticons. It has a folder with files flaticon.css, flaticon.eot, flaticon.ttf, flaticon.svg, flaticon.woff and some others. I can use the icons by simply importing the CSS into a page and doing something like <i class="flaticon-world-grid">.
Now I want to download some new flaticons and use them on my site. I found some on flaticon.com and it gives me an option to download it in multiple formats. How to "install" these files and edit my CSS so that I can use the new icons like the ones that are already there?
The css file has content like this:
.flaticon-wand2:before {
content: "\e0fb";
}
.flaticon-wealth:before {
content: "\e0fc";
}
.flaticon-website34:before {
content: "\e0fd";
}
.flaticon-world-grid:before {
content: "\e0fe";
}
Which format should I download, where to put the new files, and what to add into the css file to be able to use them?
As mentioned here you can use two or more font-face, with different font-family name.
Like this:
#font-face {
font-family: "Flaticon";
src: url("../fonts/Flaticon.eot");
src: url("../fonts/Flaticon.eot?#iefix") format("embedded-opentype"),
url("../fonts/Flaticon.woff") format("woff"),
url("../fonts/Flaticon.ttf") format("truetype"),
url("../fonts/Flaticon.svg#Flaticon") format("svg");
font-weight: normal;
font-style: normal;
}
[class^="flaticon-"], [class*=" flaticon-"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: flaticon !important;
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
}
.flaticon-arrows:before { content: "\f100"; }
.flaticon-back:before { content: "\f101"; }
/**
New Fonts to add
*/
#font-face {
font-family: "Flaticon1";
src: url("../fonts/Flaticon1.eot");
src: url("../fonts/Flaticon1.eot?#iefix") format("embedded-opentype"),
url("../fonts/Flaticon1.woff") format("woff"),
url("../fonts/Flaticon1.ttf") format("truetype"),
url("../fonts/Flaticon1.svg#Flaticon") format("svg");
font-weight: normal;
font-style: normal;
}
#media screen and (-webkit-min-device-pixel-ratio:0) {
#font-face {
font-family: "Flaticon1";
src: url(".../fonts/Flaticon1.svg#Flaticon") format("svg");
}
}
[class^="flaticon1-"]:before, [class*=" flaticon1-"]:before,
[class^="flaticon1-"]:after, [class*=" flaticon1-"]:after {
font-family: Flaticon1;
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
}
.flaticon1-shapes:before { content: "\f100"; }
.flaticon1-share:before { content: "\f101"; }
Related
I'm trying to add an external font to a website, the site does not respond at all. I'm a beginner and just learning, I work on it all day, thank you for your help.
#font-face {
font-family: "Alex";
src: url(fonts/AlexBrush-Regular.ttf) format('truetype'),
url(fonts/AlexBrush-Regular.woff) format('woff'),
url(fonts/AlexBrush-Regular.woff2) format('woff2');
}
body {
text-align: center;
}
h1 {
color: black;
font-family: "Alex";
}
.space p {
font-size: 40px;
font-family: "Alex";
}
Put the archive path inside a string
Ex:
url("fonts/AlexBrush-Regular.ttf") format("truetype"),
url("fonts/AlexBrush-Regular.woff") format("woff"),
url("fonts/AlexBrush-Regular.woff2") format("woff2");
I am completely new to website design and programming. I have created a website on Mobirise, and am storing it on Github. I am looking to change the font across the website, as I no longer like the one that I had chosen on Mobirise when I exported it to Github.
I have uploaded the font files that I would need to use to the /OpenSansFonts folder in my repository at: https://github.com/SkyBetChampionship/Sky-Bet-Championship/tree/gh-pages.
Would anybody please be able to advise me what to do next to change the font across my website?
Thank you in advance,
Adam
You can create separate *.css file with this code, or add this code in your assets/mobirise/css/mbr-additional.css (if you create separate file, don't forget import this file in your home.html.
#font-face {
font-family: 'OpenSans-Light';
src: url('/OpenSansFonts/OpenSans-Light.ttf') format('truetype');
font-weight: 300;
font-style: normal;
}
#font-face {
font-family: 'OpenSans-Light';
src: url('/OpenSansFonts/OpenSans-LightItalic.ttf') format('truetype');
font-weight: 300;
font-style: italic;
}
#font-face {
font-family: 'OpenSans';
src: url('/OpenSansFonts/OpenSans-Regular.ttf') format('truetype');
font-weight: 400;
font-style: normal;
}
#font-face {
font-family: 'OpenSans';
src: url('/OpenSansFonts/OpenSans-RegularItalic.ttf') format('truetype');
font-weight: 400;
font-style: italic;
}
#font-face {
font-family: 'OpenSans-Semibold';
src: url('/OpenSansFonts/OpenSans-SemiBold.ttf') format('truetype');
font-weight: 600;
font-style: normal;
}
#font-face {
font-family: 'OpenSans-SemiBold';
src: url('/OpenSansFonts/OpenSans-SemiBoldItalic.ttf') format('truetype');
font-weight: 600;
font-style: italic;
}
#font-face {
font-family: 'OpenSans';
src: url('/OpenSansFonts/OpenSans-Bold.ttf') format('truetype');
font-weight: 700;
font-style: normal;
}
#font-face {
font-family: 'OpenSans';
src: url('/OpenSansFonts/OpenSans-BoldItalic.ttf') format('truetype');
font-weight: 700;
font-style: italic;
}
#font-face {
font-family: 'OpenSans';
src: url('/OpenSansFonts/OpenSans-ExtraBold.ttf') format('truetype');
font-weight: 800;
font-style: normal;
}
#font-face {
font-family: 'OpenSans';
src: url('/OpenSansFonts/OpenSans-ExtraBoldItalic.ttf') format('truetype');
font-weight: 800;
font-style: italic;
}
For change font across web site, add to body in assets/mobirise/css/mbr-additional.css font-family property.
body {
font-family: 'OpenSans';
font-weight: 400;
font-style: normal;
line-height: 1.5;
}
For import separate css file with fonts, add in your home.html around 42 string this code:
<link rel="stylesheet" href="your_path_to_file/file_with_fonts.css" type="text/css">
When you want another style of font, use font-family, font-weight and font-style properties.
Feel free ask other questions :) Hope this will help you
I want to replace the images with new ones but the problem is that the images are in font style.
Now I want to replace the following with normal image source, like
<img src="images/upload.png>
Below is the CSS file in which I want to make changes
#font-face {
font-family: "fl-bigmug-line";
src: url("../fonts/fl-bigmug-line.eot");
src: url("../fonts/fl-bigmug-line.eot#iefix") format("embedded-opentype"),
url("../fonts/fl-bigmug-line.woff") format("woff"),
url("../fonts/fl-bigmug-line.ttf") format("truetype"),
url("../fonts/fl-bigmug-line.svg") format("svg");
font-weight: normal;
font-style: normal;
}
.fl-bigmug-line-ico,
[class^="fl-bigmug-line-"]:before, [class*=" fl-bigmug-line-"]:before,
[class^="fl-bigmug-line-"]:after, [class*=" fl-bigmug-line-"]:after {
font-family: 'fl-bigmug-line';
font-size: inherit;
font-weight: 400;
font-style: normal;
}
.fl-bigmug-line-add137:before {
content: "\e000";
}
.fl-bigmug-line-add139:before {
content: "\e001";
}
.fl-bigmug-line-add149:before {
content: "\e002";
I tried to change the content like content: url("images/upload.png"); but it's not working.
You can do something like this:
.the-icon {
display: inline-block;
width: 30px;
height: 30px;
}
.the-icon:before {
content: url("https://www.gravatar.com/avatar/3116de43059d7ea110181a5bb773bcdd?s=30");
}
<div class="container">
<i class="the-icon"></i> Upload
</div>
I want to give my website some icons. Now I see that many people use this website Flaticon.
What I have done is put something like this in my CSS:
/**
* Font 1
*/
#font-face {
font-family: "Flaticon1";
src: url("flaticon1.eot");
src: url("flaticon1.eot#iefix") format("embedded-opentype"), url("flaticon1.woff") format("woff"), url("flaticon1.ttf") format("truetype"), url("flaticon1.svg") format("svg");
font-weight: normal;
font-style: normal;
}
[class^="flaticon1-"]:before,
[class*=" flaticon1-"]:before,
[class^="flaticon1-"]:after,
[class*=" flaticon1-"]:after {
font-family: "Flaticon1";
font-size: 20px;
font-style: normal;
margin-left: 20px;
}
.flaticon1-basic21:before {
content: "\e000";
}
.flaticon1-bicycle21:before {
content: "\e001";
}
.flaticon1-car6:before {
content: "\e002";
}
/**
* Font 2
*/
#font-face {
font-family: "Flaticon2";
src: url("flaticon2.eot");
src: url("flaticon2.eot#iefix") format("embedded-opentype"), url("flaticon2.woff") format("woff"), url("flaticon2.ttf") format("truetype"), url("flaticon2.svg") format("svg");
font-weight: normal;
font-style: normal;
}
[class^="flaticon2-"]:before,
[class*=" flaticon2-"]:before,
[class^="flaticon2-"]:after,
[class*=" flaticon2-"]:after {
font-family: "Flaticon2";
font-size: 20px;
font-style: normal;
margin-left: 20px;
}
.flaticon2-basic21:before {
content: "\e000";
}
.flaticon2-bicycle21:before {
content: "\e001";
}
.flaticon2-car6:before {
content: "\e002";
}
http://support.flaticon.com/hc/en-us/articles/205019862-CSS-code-for-Iconfont-
I downloaded the wanted icon but it doesn't display the icon. It displays this:
What have I done wrong?
1. Prepare your collection
Add monocolor icons to the collection for your website
2. Download iconfont
Open your collection and press the Download collection button, then select Iconfont
3. Prepare your collection
Copy the source files and CSS to your web folder.
4. Load the stylesheet
Request the CSS stylesheet from the head of your web.
< link rel="stylesheet" type="text/css" href="your_website_domain/css_root/flaticon.css" >
5. Use the classes
Use the classes of each icon and they will appear on your website. After, manipulate them with CSS.
Use example:
<i class="flaticon-airplane49"></i> or <span class="flaticon-airplane49"></span>
Apparently I downloaded file formats, not font files. I was only able to download icons as either Iconfont or SVG sprite after I have put icons in my collection. It downloads the whole collection of course.
Just download the icon and put this in the head:
<link rel="icon" href="resources/filename"/>
You need to have the flaticon.css file in your server (and the other 5 or 6).
Then check which items are available there.
.flaticon-bath:before { content: "\f122"; }
And then you just use the class.
To fix the size...
font-family: Flaticon;
font-size: 50px;
font-style: normal;
margin-left: 7px;
}
This is how you can change the font size, just paste the below code in your css file and that's it.
[class^="flaticon-"]:before, [class*=" flaticon-"]:before, [class^="flaticon-"]:after, [class*=" flaticon-"]:after {
font-size: 150px;
}
After much review, I can't get the correct display of a custom font I created through fontsquirrel. Chrome's Inspector shows the icon is in place but all I get is this default icon box ;o(
Rails 4 app, Bootstrap
Any ideas?
application.rb:
config.assets.paths << Rails.root.join("app", "assets", "fonts")
html:
<div class="hatfont icon-balloon01"></div>
here's my CSS:
hatfont {
font-family: 'haticon';
text-transform: uppercase;
div {
font-family: haticon;
}
}
#font-face {
font-family: 'haticon';
src:assets-url('fonts/haticon.eot');
src:assets-url('fonts/haticon.eot?#iefix') format('embedded-opentype'),
assets-url('fonts/haticon.woff') format('woff'),
assets-url('fonts/haticon.ttf') format('truetype'),
assets-url('fonts/haticon.svg#haticon') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="icon-"], [class*=" icon-"] {
font-family: 'haticon';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-graphs:before {
content: "\e600";
}
I've had this issue before myself. I can't identify the problem specifically from what you've provided, but a few things come to mind. Check your link references in your CSS. Make sure no files were moved and that your stylesheet is in the same directory as your fonts folder. Also, the %> under your font-face looks out of place... I don't know if that's a Rails thing or not. Here's an example of something that I've used before that's worked. Obviously, you'd need to substitute your font files. :
#font-face {
font-family: 'FontAwesome';
src: url('fonts/fontawesome-webfont.eot?v=4.0.3');
src: url('fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'),url('fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'),url('fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'),url('fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}