Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

CSS Font Styling

By editor , 7 October, 2016

Standard weights:

medium -> font-weight : 500;
semi-bold ->font-weight : 600;

Font Face

Example

@font-face {
  font-family: 'Open Sans';
  font-weight: 400;
  font-style: normal;
  src: url('../fonts/Open-Sans-regular.eot');
  src: url('../fonts/Open-Sans-regular.eot?#iefix') format('embedded-opentype'),
  local('Open Sans'),
  local('Open-Sans-regular'),
  url('../fonts/Open-Sans-regular.woff2') format('woff2'),
  url('../fonts/Open-Sans-regular.woff') format('woff'),
  url('../fonts/Open-Sans-regular.ttf') format('truetype'),
  url('../fonts/Open-Sans-regular.svg#OpenSans') format('svg');
}

Font face With Unicode-range

@font-face {
  font-family: 'myfontstyle';
  url('../fonts/font_style.ttf') format('truetype');
  unicode-range: U+40;
}
div {
  font-size: 4em;
  font-family: myfontstyle;    
}

unicode-range Syntax
unicode-range: U+26;               /* single codepoint */
unicode-range: U+0-7F;
unicode-range: U+0025-00FF;        /* codepoint range */
unicode-range: U+4??;              /* wildcard range */
unicode-range: U+0025-00FF, U+4??; /* multiple values */

 

 

More : http://www.w3schools.com/cssref/css3_pr_font-face_rule.asp

Tags

  • CSS
  • Code
  • Theming
Basic CSS Styling tips

Comments

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer