issue with css - class not displayed - html

I ran into an issue I cannot reproduce on my local apache.
A class of my css is not taken into account by my html.
The positionTitleRec class is not accepted (e..g color is not displayed). Yet, when I'm putting the other class positionFrenchRec, the color is displayed properly
/* nanum-pen-script-regular - latin */
#font-face {
font-family: 'Nanum Pen Script';
font-style: normal;
font-weight: 400;
src: url('../fonts/nanum-pen-script-v15-latin-regular.eot');
/* IE9 Compat Modes */
src: local('Nanum Pen'), local('NanumPen'), url('fonts/nanum-pen-script-v15-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('fonts/nanum-pen-script-v15-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('fonts/nanum-pen-script-v15-latin-regular.woff') format('woff'), /* Modern Browsers */
url('fonts/nanumpenscript-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('fonts/nanum-pen-script-v15-latin-regular.svg#NanumPenScript') format('svg');
/* Legacy iOS */
}
#font-face {
font-family: 'Raleway Script';
font-style: normal;
font-weight: 400;
src: local('Raleway'), local('Raleway'), url('fonts/Raleway-SemiBold.ttf') format('truetype');
}
#font-face {
font-family: 'Montserrat Script';
font-style: normal;
font-weight: 400;
src: local('Montserrat'), local('Montserrat'), url('fonts/Montserrat-Regular.ttf') format('truetype');
}
.positiontitleRec {
position: absolute;
left: 5.1%;
right: 50.85%;
top: 3.64%;
bottom: 60.33%;
font-family: Montserrat Script;
font-style: normal;
font-weight: normal;
font-size: 60px;
line-height: 30px;
color: #E1C89B;
}
.positionFrenchRec {
position: absolute;
left: 5.1%;
right: 61.75%;
top: 10.7%;
bottom: 45.8%;
font-family: Raleway Script;
font-style: normal;
font-weight: normal;
font-size: 20px;
line-height: 30px;
color: #E1C89B;
}
<p class="positionTitleRec">
Bienvenue
</p>
<p class="positionFrenchRec">
<br>
<br>Yo soy Andy.
<br>
</p>

In your CSS, .positiontitleRec needs a capital T as classes are case-sensitive.

Related

CSS Font issue on iOS Phone

There is a problem with fonts on iOS devices, these are the differences:
ANDROID/WEB IMAGE (correct)
IOS IMAGE (wrong)
The text appears to be in italics but I have never set it.
This is my font-face:
#font-face {
font-family: "Acumin Variable Concept";
src: url("font/Acumin/Acumin-Variable-Concept.ttf") format("truetype");
font-style: normal;
font-weight: 200;
font-display: swap;
}
#font-face {
font-family: "Acumin Variable Concept";
src: url("font/Acumin/Acumin-Variable-Concept.ttf") format("truetype");
font-style: normal;
font-weight: 400;
font-display: swap;
}
#font-face {
font-family: "Acumin Variable Concept";
src: url("font/Acumin/Acumin-Variable-Concept.ttf") format("truetype");
font-style: normal;
font-weight: 600;
font-display: swap;
}
#font-face {
font-family: "Acumin Variable Concept";
src: url("font/Acumin/Acumin-Variable-Concept.ttf") format("truetype");
font-style: normal;
font-weight: 900;
font-display: swap;
}
/* Typography */
p{
font-family:'Acumin Variable Concept';
font-size: 1.5rem;
text-align: justify;
line-height: 2rem;
font-weight: 400;
-webkit-font-smoothing: antialiased;
margin-bottom: 2rem;
}
b{
font-weight: 600;
color: var(--brand);
}
What could it be?
Thanks in advance,
Simone
you can try to set behind your font an "!important" like
font-family: "Acumin Variable Concept" !important;
regards
Jonas

How do I use Material Icons Outline to a ::before element offline

I would like to know is it possible to use the outline type of the material fonts while they are downloaded locally to a ::before or ::after element? The closest I got is explained in this thread -
How to host material icons offline?
(you can scroll to the lower part of the thread or just simply press crtl+f and in the find window type "outline" and it will get you there - starting from the second result).
Here a dude named Wale explaines step by step how to use the outline type and indeed it works. I add an i-tag to the HTML with the class material-icons-outline, the icon is diplayed perfectly. However, when I try to do the same to a ::before element nothing is displayed. If anyone has an idea how this can be contemplate to work, a help will be much appreciated. Here are my HTML and CSS.
<div class="connected-house-links">
<ul>
<li class="material-icons">Енергетска Ефикасност</li>
<li class="material-icons">Безбедност и Сигурност</li>
<li class="material-icons-outline">Комфорт</li>
<li class="material-icons">Заштита на најмилите</li>
</ul>
</div>
//setting up to use both type of icons
#font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(MaterialIcons-Regular.eot); /* For IE6-8 */
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(MaterialIcons-Regular.woff2) format('woff2'),
url(MaterialIcons-Regular.woff) format('woff'),
url(MaterialIcons-Regular.ttf) format('truetype');
}
#font-face {
font-family: 'Material Icons Outline';
font-style: normal;
font-weight: 400;
src: url(Material-Icons-Outline.eot); /* For IE6-8 */
src: local('Material Icons'),
local('Material Icons-Outline'),
url(Material-Icons-Outline.woff2) format('woff2'),
url(Material-Icons-Outline.woff) format('woff'),
url(Material-Icons-Outline.ttf) format('truetype');
}
.material-icons-outline {
font-family: 'Material Icons Outline';
}
.material-icons {
font-family: 'Material Icons';
}
.material-icons-outlined,
.material-icons {
font-weight: normal;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: 'liga';
}
//using the desired fonts in css
.connected-house-links ul .material-icons:first-child::before {
content: '\e1a3';
font-weight: 100;
transform: scale(2);
position: absolute;
left: -2em;
bottom: -0.2em
}
.connected-house-links ul .material-icons:nth-child(2)::before {
content: '\e8e8';
transform: scale(2);
position: absolute;
left: -2em;
bottom: -0.2em
}
.connected-house-links ul .material-icons:nth-child(3)::before {
font-family: 'Material Icons Outline';
content: '\e88a';
transform: scale(2.3);
position: absolute;
left: -2em;
bottom: -0.1em
}
.connected-house-links ul li:last-child::before {
font-family: 'connected-home-icons';
content: '\e900';
transform: scale(1.7);
position: absolute;
left: -2em;
bottom: -0.1em
}

Self hosted google font not smooth in any browser

I got the "Lato" google font and want to self-host it (because of performance). I got it implemented and it looks shitty and not smooth in any browser, it looks really pixelated!
#font-face {
font-family: 'lato';
src: url('font/latoFont.eot');
src: url('font/latoFont.eot?#iefix') format('embedded-opentype'),
url('font/latoFont.ttf') format('truetype'),
url('font/latoFont.woff2') format('woff2'),
url('font/latoFont.woff') format('woff');
font-weight: 500;
font-style: normal;
}
html {
font-family: 'lato', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
font-size: 10px;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1.4rem;
color: #212121;
}
What can i do to get more satisfying and smooth results?
I usually use this hotfix
/*FIX FONT FOR GOOGLE CHROME ON WINDOWS*/
#media screen and (-webkit-min-device-pixel-ratio:0) {
#font-face {
font-family: 'MyFont';
src: url('fonts/myfont.svg#myfont') format('svg');
font-weight: normal;
font-style: normal;}
}
You can read more here

Can't figure out why the font for my logo isn't working

I'm trying to figure out why the font for my logo isn't downloading for other people. The font is called Aerokids.
The code in my CSS works fine for the other font type I have on my site. It's just the logo that's not working, even though it's done the same way. Does anyone have any ideas what might be wrong? Here is a screenshot of the fonts I have in the subfolder for my site:
Here is the GitHub URL for the site I'm working on.
#font-face {
font-family: 'Aerokids';
src: url('fonts/Aerokids.otf');
font-weight: normal;
font-style: normal;
font-family: 'odudo-semibold';
src: url('../fonts/odudo-semi-bold.eot');
src: url('../fonts/odudo-semi-bold.eot?#iefix') format('embedded-
opentype'),
url('../fonts/odudo-semi-bold.woff2') format('woff2'),
url('../fonts/odudo-semi-bold.woff') format('woff'),
url('../fonts/odudo-semi-bold.ttf') format('truetype'),
url('../fonts/odudo-semi-bold.svg#youworkforthem') format('svg');
font-weight: normal;
font-style: normal;
}
.logo {
font-family: 'Aerokids';
font-weight: normal;
color: #00E8FF;
font-size: 2.5em;
float: left;
width: 30%;
display: inline-block;
max-width: 100%;
height: auto;
vertical-align: middle;
margin: 0 auto;
}
You need to separate the two #font-face rules.
#font-face {
font-family: 'Aerokids';
src: url('fonts/Aerokids.otf');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'odudo-semibold';
src: url('../fonts/odudo-semi-bold.eot');
src: url('../fonts/odudo-semi-bold.eot?#iefix') format('embedded-
opentype'),
url('../fonts/odudo-semi-bold.woff2') format('woff2'),
url('../fonts/odudo-semi-bold.woff') format('woff'),
url('../fonts/odudo-semi-bold.ttf') format('truetype'),
url('../fonts/odudo-semi-bold.svg#youworkforthem') format('svg');
font-weight: normal;
font-style: normal;
}

How to implement custom icon font with CSS

I'm wondering how to implement these icons using CSS.
Here is the CSS:
.icon {
font-family: 'spokeo';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
position: relative;
}
.search_icon:before { content:'\e001'; }
.down_arrow_icon:before { content:'\e002'; }
.up_arrow_icon:before { content:'\e003'; }
...etc
And the HTML:
<div>
<i class="toc_icon"></i>Table of Contents
</div>
Any ideas?
The first thing you will need to do is import the font using #font-face in the CSS.
You will need the four major filetypes for the icons to have cross-browser functionality. These are eot ttf svg and woff. A good free resource for icon font sets is fontello.com:
#font-face {
font-family: 'spokeo';
src: url('path/to/spokeo.eot');
src: url('path/to/spokeo.eot?#iefix') format('embedded-opentype'),
url('path/to/spokeo.woff') format('woff'),
url('path/to/spokeo.ttf') format('truetype'),
url('path/to/spokeo.svg#spokeo') format('svg');
font-weight: normal;
font-style: normal;
}
The above imports the font to the browser for use later when you call the icons in your page.
You will now define the .icon class in the stylesheet like you did in your example:
.icon {
font-family: 'spokeo';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
position: relative;
}
.search_icon:before { content:'\e001'; }
.down_arrow_icon:before { content:'\e002'; }
.up_arrow_icon:before { content:'\e003'; }
And then in your HTML you would write in the icon class as well as the specific class in your icon so that it includes all of the styles associated with all icons and then the specific icon contents, like this:
<div>
<i class="icon search_icon"></i>Search
<i class="icon down_arrow_icon"></i>Down
etc...
</div>
full code with working demo
jfFiddle
html
<div>
<i class="icon search_icon"></i> Search
</div>
<div>
<i class="icon down_arrow_icon"></i> Down Arrow
</div>
<div>
<i class="icon up_arrow_icon"></i> Up Arrow
</div>
css
#font-face {
font-family: 'spokeo';
src: url('http://getbootstrap.com/fonts/glyphicons-halflings-regular.eot');
src: url('http://getbootstrap.com/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
url('http://getbootstrap.com/fonts/glyphicons-halflings-regular.woff') format('woff'),
url('http://getbootstrap.com/fonts/glyphicons-halflings-regular.ttf') format('truetype'),
url('http://getbootstrap.com/fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
}
div {
margin-bottom: 5px;
}
.icon {
font-family: 'spokeo';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
position: relative;
}
.search_icon:before {
content: '\e003';
}
.down_arrow_icon:before {
content: '\e094';
}
.up_arrow_icon:before {
content: '\e093';
}