Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [HTML][CSS]2 czcionki z @font-face
Forum PHP.pl > Forum > Przedszkole
ats2008
Witajcie.

Napotkałem problem ze wstawieniem 2 niestandardowych czcionek przy użyciu @font-face.

1 czcionkę udało mi się bez problemu ustawić, ale chcę nadać tytuły h3, h2 etc. inną czcionką.

Spróbowałem coś takiego: ale wstawia drugą czcionkę wszędzie...

Wstawiłem takie coś - nie działa:
  1. @font-face {
  2. font-family: 'Humnst777L2Roman';
  3. src: url('tt0857i_-webfont.eot');
  4. src: url('tt0857i_-webfont.eot?#iefix') format('embedded-opentype'),
  5. url('tt0857i_-webfont.woff') format('woff'),
  6. url('tt0857i_-webfont.ttf') format('truetype'),
  7. url('tt0857i_-webfont.svg#Humnst777L2Roman') format('svg');
  8. src: url('batmfa1-webfont.eot');
  9. src: url('batmfa1-webfont.eot?#iefix') format('embedded-opentype'),
  10. url('batmfa1-webfont.woff') format('woff'),
  11. url('batmfa1-webfont.ttf') format('truetype'),
  12. url('batmfa1-webfont.svg#BatmanForeverAlternateRegular') format('svg');
  13. }
  14.  
  15. body
  16. { font-family: 'Humnst777L2Roman'; }
  17. h2, h3 {font-family:'BatmanForeverAlternateRegular';}


Wynik jest taki, że zamiast humnst wyświetla się ta druga czcionka wszędzie...

gdzie robię błąd?

Dzięki za pomoc lub link. Szukałem w necie, ale nie znalazłem podpowiedzi.
!*!
@font-face deklarujesz dla 1 czcionki tylko.

http://www.css3.info/preview/web-fonts-with-font-face/

  1. @font-face { font-family: Humnst777L2Roman; src: url('Delicious-Roman.otf'); }
  2. @font-face { font-family: BatmanForeverAlternateRegular; font-weight: bold; src: url('Delicious-Bold.otf'); }


Poza tym za dużo tych deklaracji dajesz, wystarczy jedna.
ats2008
O, dzięki.

Próbowałem tak, ale za pierwszym razem nie wyszło.

Użyłem takiego kodu - działa pięknie :

  1. @font-face {
  2. font-family: 'Humnst777L2Bold';
  3. src: url('tt0859i_-webfont.eot');
  4. src: url('tt0859i_-webfont.eot?#iefix') format('embedded-opentype'),
  5. url('tt0859i_-webfont.woff') format('woff'),
  6. url('tt0859i_-webfont.ttf') format('truetype'),
  7. url('tt0859i_-webfont.svg#Humnst777L2Bold') format('svg');
  8.  
  9. }
  10. @font-face {
  11. font-family: 'BatmanForeverAlternateRegular';
  12. src: url('batmfa1-webfont.eot');
  13. src: url('batmfa1-webfont.eot?#iefix') format('embedded-opentype'),
  14. url('batmfa1-webfont.woff') format('woff'),
  15. url('batmfa1-webfont.ttf') format('truetype'),
  16. url('batmfa1-webfont.svg#BatmanForeverAlternateRegular') format('svg');
  17. }


Dzięki - zamykam temat.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.