Announcement

Collapse
No announcement yet.

Eigene Schriftart wird nicht erkannt.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Eigene Schriftart wird nicht erkannt.

    Hallo ZUsammen

    Ich habe eine CSS Datei erstellt, welche alle Informationen aus einer Datenbank holt.
    Die CSS Funktioniert einwandfrei. Für Schriftgrösse, Schriftfarbe, Linkfarbe, usw. Nur mit der Schriftart habe ich Probleme, dass der Browser(egal welchen "Edge, GoogleChrome, Iron") davon nichts wissen will.

    In meiner CSS (auf PHP Basis) habe ich folgende Zeile hinzugefügt.

    echo 'font-face {font-family:'.$schriftart.'src: url(../schrift/'.$schriftartdatei.') format(woff2); }';


    ​Setze ich zb. diesen Code direkt in die PHP Datei geht es.
    @import url('https://fonts.googleapis.com/css2?family=Sacramento&display=swap');​



    Ich verstehe nicht, warum es in der CSS Datei nicht geht.

  • #2
    Dann schau im Quelltext nach, was aus
    echo 'font-face {font-family:'.$schriftart.'src: url(../schrift/'.$schriftartdatei.') format(woff2); }';
    erzeugt wird

    Christian

    Comment


    • #3
      So sieht die CSS Datei aus, wenn man die anschaut als Ergebnis. Ich sehe da keinen Fehler.

      @font-face {font-family:'font-family:sacramento;' src: url('../schrift/sacramento.woff2') format('woff2'); }html{font-family:sacramento;font-size:10;color:#4D4D4D;background-size: cover; background-image: url("../hintergrund/weihnachtshintergrund-mit-bokeh-und-schneeflocken_1393-207.jpg");background-repeat: no-repeat, repeat;margin: 0;}body{font-family:sacramento;color:#4D4D4D;font-size:10;margin: 0;}h1{font-family:sacramento;font-size:55;color:#4D4D4D;margin: 0;}h2{font-family:sacramento;font-size:55;color:#4D4D4D;margin: 0;}h6{font-family:sacramento;color:#4D4D4D;margin: 0;}table{border-spacing: 0;border-collapse: collapse;empty-cells: hide;}tr{border: none;padding: 0;}td{font-family:sacramento;font-size:10;color:#4D4D4D;border: none;padding: 0;}img{margin: 0;font-weight: bold;padding: 0;border: none;display: block;}a:link {color:#000000;}a:visited {color:#000000;}a:hover {color:#000000;}a:active {color:#000000;}

      Comment


      • #4
        https://www.w3schools.com/cssref/css...-face_rule.asp

        @font-face {font-family:'font-family:
        Christian

        Comment


        • #5
          Habe ich doch so geschrieben, wie es auf dem Link beschrieben ist..

          Comment


          • #6
            Ich sehe da 2x font-family
            Christian

            Comment


            • #7
              Habs auch gefunden, dass es 2x geschrieben hat. Nun gehts.

              Comment


              • #8
                Was war jetzt die Lösung des Problems? Sollte das nur einmal da stehen?

                Comment


                • #9
                  Was ist an

                  Habs auch gefunden, dass es 2x geschrieben hat. Nun gehts.

                  unklar?
                  Christian

                  Comment


                  • #10
                    "font-family:'font-family:" war 2x im Code gewesen.
                    Nach dem entfernen des 2ten "font-family:'font-family:" hats funktioniert.

                    Comment

                    Working...
                    X