Fonts aren't displaying uniformly - css

some elements on my website display perfectly, while other elements of the same font look grainy and choppy. I can't figure out why since I specify the style in the same way.
Here's my website:
http://violetoeuvre.com/
The side bar navigation (me, about, writing contact) is totally fine while the paragraph, h2, and footer styles are grainy and look like a rough version of the same type face.
CSS:
/* Fonts */
#import url(http://fonts.googleapis.com/css?family=Playfair+Display:400,700,900,400italic,700italic,900italic);
Funky styles:
h2 {
font-family: 'Playfair Display', sans-serif, 20px;
font-weight: 100;
line-height: 2em;
color: #000000;
letter-spacing: -1px;
margin: 0;
}
h3 {
font-family: 'Playfair Display', sans-serif, 12px;
font-weight: 100;
line-height: 2em;
color: #000000;
letter-spacing: -1px;
margin: 0;
}
#foot a:link {
font-family: 'Playfair Display', sans-serif;
font-size: 15px;
font-weight: 100;
color:#000;
text-decoration: none;
letter-spacing:0.2em;
}
These are functioning fine:
#emma_home a:link{
font-family: 'Playfair Display', serif;
font-size: 75px;
font-weight: 200;
color:rgba(255,255,255,1);
text-decoration: none;
letter-spacing:-4px;
}
#nav_menu a:link{
font-family: 'Playfair Display', serif;
font-size: 30px;
font-weight: 100;
color:rgba (255,255,255,1);
text-decoration: none;
text-align: center;
letter-spacing:0.2em;
}
#side_wrapper_text a:link{
font-family: 'Playfair Display', sans-serif;
font-size: 32px;
font-style: italic;
font-weight: 100;
color:#000000;;
text-decoration: none;
text-align: right;
letter-spacing:0.2em;
}
Also, on a PC the top Emma and Navigation (writing, blog, contact) are about 20 pixels ABOVE the black line, but on my Mac, the letters touch the white like I want.
What gives with these discrepancies??
Thanks.

I think you should move font-size property from font-family tag
and add it
font-family: sans-serif;
font-size : 12px;
check this W3 Schools they define 2 properties
Browsers behave differently with css some adapt the error some not
EDIT
You can save yourself from repeating code by putting the selector that have same styles mostly and then you can overwrite that style. for ex
h2,h3 {
font-family: 'Playfair Display', sans-serif;
font-size : 20px;
font-weight: 100;
line-height: 2em;
color: #000000;
letter-spacing: -1px;
margin: 0;
}
h3 {
font-size: 12px;
}
I see your a link has font weight property double than you defined for other so that may be the case for a tags but i dont see any other significant difference

I was confused as to why Playfair Display appeared grainy in my headings and paragraphs, but NOT in my sidebar navigation.
After some frustration, I realized that the typeface just looks bad at a certain (small) font.
Search for Playfair:
http://www.google.com/fonts/
As you can see, Normal 400 looks very weird, but in larger, bold, or italic styles, it looks just fine. The only thing to do was to choose a similar typeface for smaller styles, so I'm using Jacques Francois.

I'm a designer that works mostly in web but occasionally print as well. I think your issue may actually be with the Playfair font itself which I have just discovered is missing certain font styles when it displays on PCs (Macs look fine). I would test with another font before losing much more time.

As far as I can see IE prefers ttf format over woff and that specific exports is wrong. I simply downloaded the google font mercurial repo any converted original (otf) files with font squirrel, now it works.

Related

how to force font down the css tree?

I have a situation that I can't seem to figure out with CSS.
I have a sidebar category menu that I want to be a certain font.. but the other content when it is in the sidebar to be the standard font.
The issue is that the div structure looks like this.
...
<div class="col-left sidebar">
<div id"sidebar-nav" class"block sidebar-nav-left codnitiveSidenavLeft">
<div class="block-title">..</div>
<div class="block-content">
Now what happens is that block-content has a font value in css which is the normal font.. when it is not under the class "block sidebar-nav-left coditiveSidenameLeft" then that is fine.. when it is under the "block sidebar-nav-left coditiveSidenameLeft" class then I want to use a special font called destroyregular.. here is what I have in the css.
.block .block-content {
padding: 5%;
font-family: 'Lato',sans-serif;
/*font-family: "destroyregular";*/
font-size: 100%;
font: bold 12px Arial, sans-serif;
color: #FFFFFF;
text-transform: uppercase;
}
#sidebar-nav.block.sidebar-nav-left.codnitiveSidenavLeft
{
padding: 5%;
font-family: "destroyregular" !important;
font-size: 100%;
/*font: bold 12px Arial, sans-serif;*/
color: #E6E6E6;
text-transform: uppercase;
}
While container class"block sidebar-nav-left coditiveSidenameLeft" does have the destroyregular font, it is overridden by the block-content.. how can I force the destroyregular font down to the block-content only if it is under it?
Thanks in advance..
--Corrected typo in div... side-nav was corrected to sidebar-nav sorry..
--Corrected typo #2!! arrgh.. #sidebar-nav.block.sidebar-nav-left codnitiveSidenavLeft
-Ken
Change the sidebar and .block-content to this:
#side-nav
{
padding: 5%;
font-family: "destroyregular", Arial, sans-serif;
font-size: 12px;
font-weight: bold;
color: #E6E6E6;
text-transform: uppercase;
}
.block-content {
padding: 5%;
font-family: 'Lato', Arial, sans-serif;
font-size: 12px;
font-weight: bold;
color: #FFFFFF;
text-transform: uppercase;
}
This selector:
#sidebar-nav.block.sidebar-nav-left.codnitiveSidenavLeft
Doesn't select anything in that HTML snippet you posted. The ID and class names don't match.
UPDATE: With the corrected selector, what's going on now is that the font destroyregular is getting applied with very high specificity to the .block, but .block-content will not inherit it over something set specifically for .block-content jsut because the parent has high specificity. This is how I would do it, same HTML and add this CSS:
#sidebar-nav.block.sidebar-nav-left.codnitiveSidenavLeft .block-content {
font-family: "destroyregular";
}
This is not optimal. I think it's overspecified. And probably you can get rid of the font definition on the other (overspecified) selector and move it to that one, but that depends on what you actually need.

Issue with font rendering in browser

Result sample:
font rendering issue sample
As you can see two letters "f" and "l" are bold in every browsers and my styles.css doesn't have any rules for it. I'm not sure, but think that is due a problem with font's rendering ("HelveticaNeueW01-45Ligh, Helvetica Neue,Helvetica,sans-serif").
I tried to use "text-rendering: optimizeLegibility" property, but it doesn't seem to help.
<p style="text-rendering: optimizelegibility;">Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows. Separated they live in Bookmarksgrove right at the coast of the Semantics.</p>
and Styles:
element {
text-rendering: optimizelegibility;
}
body.home .entry-content p {
margin: 20px 0px;
font-family: "HelveticaNeueW01-45Ligh",Helvetica Neue,Helvetica,sans-serif;
font-weight: normal;
font-style: normal;
font-size: 1.9em;
}
body.home .entry-content p {
margin: 20px 0px;
font-family: "HelveticaNeueW01-45Ligh",Helvetica Neue,Helvetica,sans-serif;
font-weight: normal;
font-style: normal;
font-size: 1.9em;
}
body.page-template-default .entry-content p {
font-size: 1.6em;
line-height: 1.5;
margin-bottom: 15px;
}
.entry-content p {
font-size: 1.6em;
line-height: 1.7;
}
.entry-content p {
margin: 0px 0px 15px;
font-size: 1.6em;
line-height: 1.7;
}
p {
margin-bottom: 1.5em;
}
body, button, input, select, textarea {
color: #404040;
font-family: "HelveticaNeueW01-55Roma",Helvetica Neue,Helvetica,sans-serif;
font-weight: normal;
font-style: normal;
line-height: 1.5;
}
What can I do to improve how this font is being rendered?
text-redering / ligatures
You've mentioned already that you've tried the following css attribute.
text-rendering: optimizeLegibility;
There may be a few more things for you to consider, from Article "Make Your Web Pages More Legible With Ligatures":
"To turn on standard ligatures, use:"
p { font-variant-ligatures: common-ligatures; }
"To gain support in all browsers, while using text-rendering: optimizeLegibility as a fallback":
p {
/* optional: for older browsers */
text-rendering: optimizeLegibility;
/* for iOS and Safari 6 */
-webkit-font-variant-ligatures: common-ligatures;
/* for up-to-date browsers, including IE10 and Opera 21 */
font-variant-ligatures: common-ligatures;
}
Recommended article:
Css-Tricks: text-rendering
font-smoothing
Another way to improve font appearance:
-webkit-font-smoothing: antialiased; // chrome - safari
-moz-osx-font-smoothing: grayscale; // mozilla
Two recommended articles:
Font smoothing explained
Font Smoothing in Webkit and Firefox

CSS Grid 2 columns aren't in the correct position

I have the following example Jsfiddle where i've posted all 12 columns and the required css. the next piece of code i think it's the one that's causing the problems. In the live example you will notice that these two columns at less than 320px screen width will break the container and scrollbar will appear. I've tried fixing this problem but i didn't find a solution so far. Anyone around who can help me out ?
<div class="col-mb-2 col-8 col-dt-5"><p> </p></div>
<div class="col-mb-2 col-2 col-dt-8"><p> </p></div>
Update:
Added a picture to see the portion of the problem
so you need to write media query
#media (max-width:312px) {
.col-dt-5, .col-dt-8{padding:0px 2px !important}
}
(max-width:312px) means, the width of the scree is 312px or less
I think the problem is with this class:
.testgrid p {
background: #5d68c2;
margin-bottom: 2em;
font-size: 0.75em;
line-height: 1em;
padding: 1em; /* <--- this is the problem */
color: #ffffff;
text-transform: uppercase;
font-weight: 800;
font-family: "Open Sans", Helvetica, Arial, Sans-serif
}
you need to remove left and right padding:
.testgrid p {
background: #5d68c2;
margin-bottom: 2em;
font-size: 0.75em;
line-height: 1em;
padding: 1em 0px; /* updated */
color: #ffffff;
text-transform: uppercase;
font-weight: 800;
font-family: "Open Sans", Helvetica, Arial, Sans-serif;
}
I tried box-sizing but not worked.
view this: DEMO

custom soundcloud player (minimal) font color stays black

Again, moved from github, so sorry for cross-posting.
I have adapted the minimal player and can't get the font color for the title of the tracks to change. All other font attributes change, but the font colour always remains black:
.sc-player {
font-family: Century Gothic, sans-serif;
color: grey;
font-size: 12px;
line-height: 1.6em;
font-weight: none;
text-transform: lowercase;
}
How do I change the color attribute?
Thanks
.sc-player ol li a { color:grey; } should work fine for you
or just .sc-player a { color:grey; }

CSS specify font-size for each font in font-family?

The layout for my main navigation will shift incorrectly if the font used is too large (actually if too wide).
The first font in the font family looks great at a specific font, however the second font (which will be used if they do not have the first) is too wide and will shift the layout.
I did find this similar quesiton which was because the font was too tall. The answer was to use the ex unit because it is based off height.
Is there a unit I can use for width, or is there a way to specify the font-size for each font in the font-family?
Consider supplying similar fonts as alternatives. For instance:
font-family: Arial, Helvetica, sans-serif;
font-family: Tahoma, Geneva, sans-serif;
That way, the alternative font won't make the layout break.
Ideally for fonts I would suggest using standard classes such as x-small (extremeley small), small, medium, med-small, large, med-large, x-large etc., and use these classes for different font sizes. Only if you want something really big, you can always use <h1>, <h2> tags. I would use % as the standard for all of these. In my usage with various fonts, they rarely have broken the below classes used.
.body {
font-family: arial,helvetica,clean,sans-serif;
}
.x-small {
font-size: 77%;
letter-spacing: normal;
}
.small {
font-size: 85%;
letter-spacing: normal;
}
.med-small {
font-size: 92%;
letter-spacing: normal;
}
.medium {
font-size: 100%;
letter-spacing: normal;
}
.med-large {
font-size: 107%;
letter-spacing: normal;
}
.large {
font-size: 114%;
letter-spacing: normal;
}
.x-large {
font-size: 122%;
letter-spacing: normal;
}
.x2-large {
font-size: 131%;
letter-spacing: normal;
}
.x3-large {
font-size: 138.5%;
letter-spacing: normal;
}
.strong {
font-weight: bold;
}

Resources