WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
×

CSS Reference

CSS Reference CSS Selectors CSS Functions CSS Reference Aural CSS Web Safe Fonts CSS Animatable CSS Units CSS PX-EM Converter CSS Colors CSS Color Values CSS3 Browser Support

CSS Properties

align-content align-items align-self all animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-shadow box-sizing caption-side clear clip color column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns content counter-increment counter-reset cursor direction display empty-cells filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font @font-face font-family font-size font-size-adjust font-stretch font-style font-variant font-weight hanging-punctuation height justify-content @keyframes left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top max-height max-width @media min-height min-width nav-down nav-index nav-left nav-right nav-up opacity order outline outline-color outline-offset outline-style outline-width overflow overflow-x overflow-y padding padding-bottom padding-left padding-right padding-top page-break-after page-break-before page-break-inside perspective perspective-origin position quotes resize right tab-size table-layout text-align text-align-last text-decoration text-decoration-color text-decoration-line text-decoration-style text-indent text-justify text-overflow text-shadow text-transform top transform transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi vertical-align visibility white-space width word-break word-spacing word-wrap z-index



 

CSS3 @font-face Rule


Example

Specify a text style named "myFirstFont", and indicate the URL where it tends to be found:

@font-face {
    text style family: myFirstFont;
    src: url(welookups.woff);
}

Definition and Usage

With the @font-face rule, website specialists do never again need to utilize one of the "web-safe" fonts.

In the new @font-face rule you should initially characterize a name for the textual style (for example myFirstFont), and afterward point to the textual style file.

Tip: Use lowercase letters for the textual style URL. Capitalized letters can give surprising outcomes in IE!

To utilize the textual style for a HTML component, allude to the name of the textual style (myFirstFont) through the textual style family property:

div {
    textual style family: myFirstFont;
}

Browser Support

The @font-face rule is upheld in Internet Explorer, Firefox, Opera, Chrome, and Safari.

The numbers in the table indicates the main program form that completely underpins the textual style format.

Font format
TTF/OTF 4.0 12.0* 9.0* 3.5 3.1 10.0
WOFF 5.0 12.0 9.0 3.6 5.1 11.1
WOFF2 36.0 Not supported Not supported 35.0* Not supported 26.0
SVG 4.0 Not supported Not supported Not supported 3.2 9.0
EOT Not supported 12.0 6.0 Not supported Not supported Not supported

*Edge and IE: The textual style position possibly works when set to be "installable".

*Firefox: Disabled as a matter of course, yet can be empowered (need to set a banner to "true" to utilize WOFF2).


Syntax

@font-face {
    font-properties
}

Font descriptor Values Description
font-family name Required. Characterizes the name of the font.
src URL Required. Characterizes the URL(s) where the textual style ought to be downloaded from
font-stretch normal
condensed
ultra-condensed
additional condensed
semi-condensed
expanded
semi-expanded
additional expanded
ultra-expanded
Optional. Characterizes how the text style ought to be extended. Default esteem is "normal"
font-style normal
italic
oblique
Optional. Characterizes how the textual style ought to be styled. Default esteem is "normal"
font-weight normal
bold
100
200
300
400
500
600
700
800
900
Optional. Characterizes the strength of the text style. Default esteem is "normal"
unicode-range unicode-range Optional. Characterizes the scope of unicode characters the text style bolsters. Default esteem is "U+0-10FFFF"


Example

You must include another @font-face rule containing descriptors for strong text:

@font-face {
    textual style family: myFirstFont;
    src: url(welookups.woff);
    textual style weight: bold;
}

The document "sansation_bold.woff" is another text style record, that contains the intense characters for the Sansation font.

Browsers will utilize this at whatever point a bit of content with the textual style family "myFirstFont" should render as bold.

This way you can have numerous @font-face rules for the equivalent font.