Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Ignoring font face

Tags:

css

fonts

I am putting together a website in codeIgniter, but I'm having some trouble with the CSS

The below code is giving me a serif font - I know the stylesheet's properly linked because the text fits all the other parameters, and changes when I unlink it.

span.navbig {
    font-size: 36pt;
    font-family: Gill Sans / Gill Sans MT, sans-serif;
    letter-spacing: -1.5pt;
    text-decoration: none;   
}

What am I not seeing here?

Thanks

like image 733
justacoder Avatar asked Dec 06 '25 01:12

justacoder


2 Answers

Separate thefont types in your font-family declaration different, something like this:

font-family: "Gill Sans", "Gill Sans MT", sans-serif;

Here's some easy reference:

Note: Separate each value with a comma.

Note: If a font name contains white-space, it must be quoted. Single quotes must be used when using the "style" attribute in HTML.

And here's the W3C recommendation:

Font family names must either be given quoted as strings, or unquoted as a sequence of one or more identifiers. This means most punctuation characters and digits at the start of each token must be escaped in unquoted font family names.

like image 69
Bjoern Avatar answered Dec 07 '25 16:12

Bjoern


When using FONT types that consist of two words, quotes must be placed on them so the browser does not read them as separate entries.

<style type="text/css">
    span.navbig {
      font-size: 36pt;
      font-family: "gill sans", sans-serif;
      letter-spacing: -1.5pt;
      text-decoration: none;   
    }
</style>

from http://www.htmlite.com/CSS004.php

like image 21
jwchang Avatar answered Dec 07 '25 15:12

jwchang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!