Why is my custom font overlapping on mobile? - css

I'm working on a Squarespace site and added a MyFonts web font to use for some headings and the index menu. It displays beautifully on desktop but when I view it on mobile, almost all instances of that font (Sackers Gothic) show up wrong. They either overlap, in the case of the menu, or go off screen. It seems to be more of a problem when they're center-aligned. One user also said this was a problem on her iPad, although it looked fine on mine. In the case of the home page index menu, the links should also go to a new line on mobile, as they do on my iPad.
It's CLEARLY a problem with my CSS but how do I fix it? How do I get it to display normally (ie the way it displays when I just use the built-in squarespace fonts, or the way it displays on desktop)?
The one hint I got at the root problem is that since I'm overriding the font that Squarespace is putting on, it appears that my iPhone positions the text based on what the Squarespace font would have ben, and then converts to the MyFonts font, rather than positioning it based on the MyFonts font. But again I have no idea of that's the actual problem, or how to fix it.
This is what it looks like on desktop:
And this is what it currently looks like on mobile:
Home Page
Another Page
This is all the site-wide custom CSS I'm using (in case there are more problems I'm missing).
/**
* #license
* MyFonts Webfont Build ID 3477103, 2017-11-02T21:34:57-0400
*
* The fonts listed in this notice are subject to the End User License
* Agreement(s) entered into by the website owner. All other parties are
* explicitly restricted from using the Licensed Webfonts(s).
*
* You may obtain a valid license at the URLs below.
*
* Webfont: SackersGothicMedium by Monotype
* URL: https://www.myfonts.com/fonts/mti/sackers-gothic/medium/
* Copyright: Digitized data (C) 2003 Agfa Monotype Corporation.
*
* Webfont: SackersGothicMediumAlt by Monotype
* URL: https://www.myfonts.com/fonts/mti/sackers-gothic/medium-alt/
* Copyright: Digitized data (C) 2003 Agfa Monotype Corporation.
*
*
* License: https://www.myfonts.com/viewlicense?type=web&buildid=3477103
* Licensed pageviews: 250,000
*
* © 2017 MyFonts Inc
*/
/* #import must be at top of file, otherwise CSS will not work */
#import url("//hello.myfonts.net/count/350e6f.css");
#font-face {
font-family:'SackersGothicMedium';
src: url('//static1.squarespace.com/static/54206d9ae4b0423f148f0d6c/t/59fbca489140b7d05d1be44c/1509673545091/350E6F_0_0.eot');
src: url('//static1.squarespace.com/static/54206d9ae4b0423f148f0d6c/t/59fbca489140b7d05d1be44c/1509673545091/350E6F_0_0.eot?#iefix')
format('embedded-opentype'),url('//static1.squarespace.com/static/54206d9ae4b0423f148f0d6c/t/59fbca5e9140b7d05d1be6b9/1509673566929/350E6F_0_0.woff2')
format('woff2'),url('//static1.squarespace.com/static/54206d9ae4b0423f148f0d6c/t/59fbca57f9619ab843b69aba/1509673560243/350E6F_0_0.woff')
format('woff'),url('//static1.squarespace.com/static/54206d9ae4b0423f148f0d6c/t/59fbca50e2c483cd2608015b/1509673553520/350E6F_0_0.ttf')
format('truetype');
}
#font-face {
font-family: 'SackersGothicMediumAlt';src: url('//static1.squarespace.com/static/54206d9ae4b0423f148f0d6c/t/59fbca6471c10bfd21731909/1509673572949/350E6F_1_0.eot');src: url('//static1.squarespace.com/static/54206d9ae4b0423f148f0d6c/t/59fbca6471c10bfd21731909/1509673572949/350E6F_1_0.eot?#iefix') format('embedded-opentype'),url('//static1.squarespace.com/static/54206d9ae4b0423f148f0d6c/t/59fbca7ae4966baa783e612d/1509673594306/350E6F_1_0.woff2') format('woff2'),url('//static1.squarespace.com/static/54206d9ae4b0423f148f0d6c/t/59fbca75085229ec684a6add/1509673589300/350E6F_1_0.woff') format('woff'),url('//static1.squarespace.com/static/54206d9ae4b0423f148f0d6c/t/59fbca6d8165f5e83ce3e406/1509673582003/350E6F_1_0.ttf') format('truetype');}
span.collection-nav-item-span{
font-family: 'SackersGothicMedium' !important;
}
h2.site-tagline{
font-family: 'SackersGothicMedium' !important;
}
h2{
font-family: 'SackersGothicMedium' !important;
text-transform: lowercase;
}
h1{
font-family: 'SackersGothicMedium' !important;
text-transform: lowercase;
}
blockquote{
font-family: 'SackersGothicMedium' !important;
text-align: center;
}
figcaption{
font-family: 'Raleway';
font-size: 10px !important;
font-weight: 700 !important;
letter-spacing: 0.1em !important;
text-transform: uppercase;
text-align: center !important;
}
#media only screen and (min-width: 1040px) {
span.collection-nav-item-span{
font-size: 3.7vw;
}
}
.site-branding h1 {
background-image:url(https://static1.squarespace.com/static/54206d9ae4b0423f148f0d6c/t/59fcef98e31d1945635645b1/1509748633336/FIG_17_WEB_Logo_1_dark.png);
background-repeat: no-repeat;
background-size: contain;
}
.has-index-nav.swap-header-color:not(.view-item) .site-branding h1 {
background-image:url(https://static1.squarespace.com/static/54206d9ae4b0423f148f0d6c/t/59fcede408522952619026f3/1509748197382/FIG_17_WEB_Logo_1.png);
background-repeat: no-repeat;
background-size: contain;
}
And the website is figcookingschool.com
And here's a screenshot of the HTML for that part of the homepage
HTML
Thank you SO much in advance for your help!!

Related

How to fix icons not showing in frontend wordpress

In frontend, some icons are not working : fontawsome icons and also the icons in the admin bar but only in frontend. In backend, I can see all the icons.
In custom css I found this :
#import url('https://fonts.googleapis.com/css?family=Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i');
body { color:#4c5166;
font-weight:400;
}
* { font-family: 'Montserrat', sans-serif !important;
}
and also :
.flex-direction-nav a {
font-family:icomoon !important;
}
.flex-direction-nav a {
font-family:icomoon !important;
}
Hello I've been through this before.. i solved by removing the '*' from the style like
*{
font-family: 'Montserrat', sans-serif !important;
}
Do it like this instead
body,html {
font-family: 'Montserrat', sans-serif !important;
}
NB: if you do it the first way you're practically saying all the all in tags,classes and id should take the Montserrat font which is not applicable to fontAwesome icon or any other icon

Difference in fonts in seemingly equal enviroments

I have two installations of Laravel including Bootstrap.
As far as I can see both include and have Montserrat on the body tag.
One of the installations needs no declaration of that in the app.sass (meaning it gets included with the bootstrap directly).
However, the other needs it, otherwise it defaults to the browser default font.
And yet, even when both installations have the same Montserrat #import-ed, they look different. I suspect the wrong one is really Montserrat, while the right one is some kind of Bootstrap sugar-coating that the other one can't do.
In order to check it out, please follow:
Desired effect: This link and once you log in with maximilian.berbechelov#gmail.com and 123456 click it again. I know it's Cyrillic, but I don't think it matters.
Problematic effect:
This link - no login required.
I have a body font-family declaration in the sass file (the desired one has no such declaration), because without it the font is the browser default.
You can see your font adding !important after the font-family name like this.
body {
margin: 0;
padding: 0 0 50px 0;
min-height: 100vh;
font-family: "Montserrat", sans-serif!important;
background-image: linear-gradient(45deg, #1de099, #1dc8cd);
}
.navbar-brand {
letter-spacing: 3px;
font-family: 'Montserrat', sans-serif;
font-weight: 300;
font-size: 2.1rem;
}

why the font-family are in two place in bootstrap?

I just saw in Bootstrap that its using font-family in two places one in html and another in body:
html {
font-family: sans-serif;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
...and after many lines:
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.42857143;
color: #333;
background-color: #fff;
}
So, why is font-family used in two places with the different font?
The first set of styles defined in Bootstrap.css is actually Normalize.css. Noramlize.css makes up the first 189 lines of Bootstrap.css.
If we take a look at the unminified version the full code snippet with comments is actually:
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
html {
font-family: sans-serif;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
Why is it defined twice? Because they bundle Normalize.css without modifying that CSS file that defines a font-family for the html element itself.
Normalize.css simply does it to set the base font to sans-serif. Their CSS file with comments states:
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS and IE text size adjust after device orientation change,
* without disabling user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
Bootstrap is now built using LESS. This means that the CSS is built in using variables and various different files which can sometimes overlap or have values set in different places.
First, it uses normalize.less which will make sure everything is set back to a base standard.
Line 1 - 13
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
//
// 1. Set default font family to sans-serif.
// 2. Prevent iOS and IE text size adjust after device orientation change,
// without disabling user zoom.
//
html {
font-family: sans-serif; // 1
-ms-text-size-adjust: 100%; // 2
-webkit-text-size-adjust: 100%; // 2
}
The body is then set within the scaffolding.less file which sets all the basics for bootstrap to use.
Line 26 - 33
body {
font-family: #font-family-base;
font-size: #font-size-base;
line-height: #line-height-base;
color: #text-color;
background-color: #body-bg;
}
This also happens within the SASS compiler too.
Github - Bootstrap Less
Github - Bootstrap Sass
After going inside the bootstrap LESS it is really easy to understand.
Its not a rule or workaround just a library colliding.
The html {} comes from the normalize.css inside bootstrap.
The body {} comes from the bootstrap itself.
That's because Bootstrap uses a reset stylesheet (probably packed together with bootstrap into one minified version). The goal of a reset stylesheet is to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings, and so on.
In this case the font-family reset is redundant because Boostrap changes the font right away on the body. Removing all redundant reset CSS would be a lot of work compared to very little gain.

Website logos for twitter, youtube etc

I am trying to modify some website code that I have got from a template. In the css file i have a number of lines of code which look as follows - and i assume these are the logos to be referenced;
/*********************************************************************************/
/* Icons */
/* Powered by Font Awesome by Dave Gandy | http://fontawesome.io */
/* Licensed under the SIL OFL 1.1 (font), MIT (CSS) */
/*********************************************************************************/
.fa {
text-decoration: none;
}
.fa.solo {
}
.fa.solo span {
display: none;
}
.fa:before {
display:inline-block;
font-family: FontAwesome;
font-size: 1.25em;
text-decoration: none;
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing:antialiased;
-moz-osx-font-smoothing:grayscale;
}
.fa-lg{font-size:1.3333333333333333em;line-height:.75em;vertical-align:-15%}
.fa-2x{font-size:2em}
.fa-3x{font-size:3em}
.fa-4x{font-size:4em}
.fa-5x{font-size:5em}
.fa-apple:before{content:"\f179"}
.fa-windows:before{content:"\f17a"}
.fa-android:before{content:"\f17b"}
.fa-linux:before{content:"\f17c"}
.fa-dribbble:before{content:"\f17d"}
.fa-skype:before{content:"\f17e"}
.fa-foursquare:before{content:"\f180"}
.fa-trello:before{content:"\f181"}
.fa-female:before{content:"\f182"}
.fa-male:before{content:"\f183"}
.fa-gittip:before{content:"\f184"}
.fa-sun-o:before{content:"\f185"}
.fa-moon-o:before{content:"\f186"}
.fa-archive:before{content:"\f187"}
.fa-bug:before{content:"\f188"}
The issue i am having is that the logos do not appear on the webpage. Does the slash indicate that in the current directory there should be image f181,f182 and so on or do these values represent something else.
Thanks for your help.
I got the answer. These codes are from font awesome family. Down load the font awesome and link to your webpage. It will work for you.
Download Font Awesome

google chrome for mac positioning headache

i am using FF as the main testing platform and Chrome (for Mac) as the secondary.
I just noticed that Chrome is showing ~20px off positioning for CSS. (just to be clear Chrome is showing the TEXTAREA ~20px down as compared to FF)
Also Chrome is not obeying the width CSS property for TEXTAREA.
Is it just me or everyone is having this problem? I thought IE was crazy.
TEXTAREA {
background-color: white;
border: #ccc 2px solid;
color: black;
font-family: calibri, helvetica, arial, verdana, ms sans serif;
padding: 10px;
font-size: 16pt;
font-weight: normal
min-width:320px;
min-height:138px;
max-height:138px;
resize: none;
}
Is there a solution??
I think it would help if you could show us your 'troublesome' page. Maybe make a copy and upload it to the web so we can give it a check?
Whatever the case, I'm sure it has something to do with more than just the textarea itself. Perhaps its one of the containing elements, a rule on a parent div or table td or who knows. Since it's a textarea, I'm pretty sure there's a form or submit of some type involved so yeah, please show us more of your code ;)
You might find this useful anyway so that you can edit your code individually for moz or chrome:
Gecko browsers (FIREFOX):
#-moz-document url-prefix() {
/* Gecko-specific CSS here */
}
WebKit browsers (CHROME, SAFARI):
#media screen and (-webkit-min-device-pixel-ratio:0) {
/* Webkit-specific CSS here */
}
Cheers
Different browsers have different defaults. Add the following to the top of your CSS file:
* {
margin: 0;
padding: 0;
}
Also, what doctype are you using? If XHTML then "TEXTAREA" needs to be lowercase.

Resources