Wo kann ich die Schriftart einstellen?

letterbox

Banned
Registriert
Feb. 2014
Beiträge
1.057
Hallo, wo kann ich die Schriftart bestimmen:
hier mal der css-code:
HTML:
<style>

   /*Icon-Font - font-family: 'FontAwesome';*/
   @import url(http://fontawesome.io/assets/font-awesome/css/font-awesome.css);

   /*Überschriften - font-family: 'Roboto Slab', Serif;*/
   @import url(https://fonts.googleapis.com/css?family=Roboto+Slab);

   /*Fließtext - font-family: 'Roboto', Sans-Serif";*/
   @import url(https://fonts.googleapis.com/css?family=Roboto);

   /*Zahlen* - font-family: 'Merriweather';*/
   @import url(https://fonts.googleapis.com/css?family=Merriweather);

 
   /*Icon-Font - font-family: 'FontAwesome';*/
   @import url(http://fontawesome.io/assets/font-awesome/css/font-awesome.css);

   /*Überschriften - font-family: 'Roboto Slab', Serif;*/
   @import url(https://fonts.googleapis.com/css?family=Roboto+Slab);

   /*Fließtext - font-family: 'Roboto', Sans-Serif";*/
   @import url(https://fonts.googleapis.com/css?family=Roboto);

   /*Zahlen* - font-family: 'Merriweather';*/
   @import url(https://fonts.googleapis.com/css?family=Merriweather);

   /*Basisangaben*/
   @media all {
      header, nav, main, aside, footer, section, article, figure, figcaption, audio, video {
         display: block;
      }
      * {
         /*box-sizing: border-box;*/
         min-width: 1px;
      }
      html {
      }
      body {
         padding: 1rem 0.5rem 2rem 0.5rem;
         margin: 0rem 0rem 0rem 0rem;
      }
   }

   /*Schriften*/
   @media all {
      html {
         font-family: sans-serif;
         font-size: 120%;
         line-height: 1.3;
      }
      h1 {
         font-family: 'Felix titling', serif;
         font-size: 2.3rem;
		 color: #2233dd;
         letter-spacing: 0.1rem;
         margin: 0.5rem 0rem 0.5rem 0rem;
      }
      h2, h3, h4, h5, h6 {
         font-family: 'Roboto Slab', serif;
         font-size: 1rem;
         margin: 0.5rem 0rem 0.5rem 0rem;
      }
      p, li, dl, dt, address {
         font-family: Roboto, sans-serif;
         font-size: 1rem;
         font-style: normal;
         margin: 0.5rem 0rem 0.5rem 0rem;
      }
      a {
         /*darkblue*/
         color: hsla(240, 100%, 27%, 1);
         text-decoration: none;
         outline: none;
         margin: 0rem 0rem 0rem 0rem;
      }
      figcaption {
         font-family: Roboto, sans-serif;
         font-size: 0.9rem;
         margin: 0rem 0rem 0rem 0rem;
      }
   }

   /*Grafiken*/
   @media all {
      figure {
         min-width: 1px;
         max-width: 100%;
         min-height: 1px;
         margin: 0,1rem;
      }
      img {
         min-width: 1px;
         display: block;
         max-width: 100%;
         /*max-height: 100vh;*/
         border: 0;
      }
   }

   /*Listen dl*/
   @media all {
      dl {
         margin: 0.5rem 0rem 0.5rem 0rem;
      }
      dt,
      dd {
      }
      dt {
         font-weight: bold;
         margin: 0rem 0rem 0rem 0rem;
      }
      dd {
         margin: 0rem 0rem 1rem 0rem;
      }
      dd p {
         margin: 0rem 0rem 0rem 0rem;
      }
   }

   /*body*/
   @media all {
      body {
      }
   }
   @media only screen and (min-width: 1000px) {
      body {
         display: flex;
         flex-wrap: wrap;
         justify-content: center;
      }
   }

   /*.pageheader*/
   @media all {
      .pageheader {
         background-color: #97FFFF;
         border: 1px solid black;
      }
      .pageheader h1 {
         text-align: center;
	   }
	   
   }
   @media only screen and (min-width: 1000px) {
      .pageheader {
         flex-grow: 0;
         flex-shrink: 0;
         flex-basis: calc(100% - 0rem - 2px - 0rem);
      }
   }

   /*.navigation*/
   @media all {
      .navigation ,.sidebar span.Stil1{
         background-color: #63B8FF;
         padding: 0.5rem;
         margin: 0.5rem 0rem;
      
   }
     a:hover{
    
}
   @media only screen and (min-width: 1000px) {
     .navigation a,.sidebar span.Stil1,
      .navigation a:visited {
         display: block;
         color: 	#483d8b;
         font-weight: bold;
         padding: 0.3rem;
         border: 1px solid black;
         border-radius: 0.3rem;
      }
     .sidebar span.Stil1:hover{
        background-color: black;
         color: gold;
       
     }
      .navigation a:hover,
      .navigation a:active,
      .navigation a:focus {
         background-color: black;
         color: gold;
	   }

   /*.content*/
   @media all {
      .content {
         background-color: #63B8FF;
         border: 2px solid black;
         padding: 0.5rem;
         margin: 0.5rem 0rem;
      }
      .content h2 {
         color: #FFFF33;
         text-align: center;
      }
      .content figure {
         max-width: 600px;
         margin: 0rem auto;
      }
   }
   @media only screen and (min-width: 1000px) {
      .content {
         margin: 0.5rem 1rem;
         flex-grow: 0;
         flex-shrink: 0;
         flex-basis: calc(100% - 250px - 250px - 1rem - 2px - 2rem);
      }
   }

   /*.sidebar*/
   @media all {
      .sidebar {
         background-color: #63B8FF;
		 color:	#483d8b;
		  font-weight: bold;
         padding: 0.5rem;
         border: 2px solid #63B8FF;
         margin: 0.5rem 0rem;
      }
   }
   @media only screen and (min-width: 1000px) {
      .sidebar {
         flex-grow: 0;
         flex-shrink: 0;
         flex-basis: calc(250px - 1rem - 4px - 0rem);
      }
   }

 
   /*.pagefooter*/
   @media all {
      .pagefooter {
         padding: 0.5rem;
         border: 2px solid black;
         margin: 0.5rem 0rem;
      }
   }
   @media only screen and (min-width: 1000px) {
      .pagefooter {
         background-color: #97FFFF;
         flex-grow: 0;
         flex-shrink: 0;
         flex-basis: calc(100% - 1rem - 4px - 0rem);
      }
   }

   /*Vorlagen zum Kopieren*/
   /*CSS*/
   @media all {
   }
   @media only screen and (min-width: 0px) {
   }
   @media only screen and (max-width: 0px) {
   }

   .Stil1 {color: #0000FF}
 

   .Stil1 {color: #0000FF}
   </style>

Es geht um die h1 im Wort Fotografie. Sie hat momentan die gleiche Formatierung wie 'Herzlich willkommen' soll aber etwas anders sein (kleiner und evtl. andere Schriftart).
 
Bsp.:

Code:
h1, h2, h3, h4{font-family: "name der font"; font-weight: 400; color: #4c6586;}

Code:
h1.photo, h2.photo, h3.photo, h4.photo{font-family: "name der font"; font-weight: 400; color: #4c6586;}

Die "Felix titling" gibt es nicht.
 
Zuletzt bearbeitet:
Hi,

so komplett ohne Eigenleistung und dann nicht einmal ein "Bitte" oder "danke" - finde ich schon dreist, was sich manche Leute so vorstellen. Ist das hier bezahlter Helpdesk oder wie?

Lies in den einschlägigen Docs nach, steht alles drin: Hier und hier

VG,
Mad
 
Hi,

die Erwartungshaltung des TE ist die, die ich bei einem bezahlten Helpdesk erwarten würde. Daher die Frage, ob er das hier für einen eben solchen bezahlten Helpdesk hält.

VG,
Mad
 
Achso :) hatte es so verstanden, dass das Forum als unbezahlter Helpdesk herhält...naja..ist es im Grunde ja auch, aber der Kollege treibt es ganz schön auf die Spitze. Vor Allem da seine ganzen zig Anfragen im Prinzip ja auch immer auf selbe hinauslaufen obwohl die HTML Syntax sich ja nicht ändert und mit der Höflichkeit ist es auch nicht so weit her. Naja, der Erziehung ist halt auch nicht mehr was sie mal war ;)
 
Zuletzt bearbeitet:
Madman1209 schrieb:
Hi,

so komplett ohne Eigenleistung und dann nicht einmal ein "Bitte" oder "danke" - finde ich schon dreist, was sich manche Leute so vorstellen. Ist das hier bezahlter Helpdesk oder wie?

Lies in den einschlägigen Docs nach, steht alles drin: Hier und hier

VG,
Mad

Bitte - Danke
 
wiki.selfhtml.org: CSS/Eigenschaften/Schriftformatierung
Folgende CSS-Eigenschaften haben Einfluss auf die Gestaltung der Schrift:

Hier zum selber ausprobieren: w3schools.com: try css default
HTML:
<style>
h1 {
    color: white;
    text-align: center;
}

p {
    font-family: ''
    font-size: 20px;
}
</style>
Einfach die Eigenschaft/-en zwischen den geschweiften Klammern ersetzen und die 'Run' Schaltfläche (Button) anklicken. Z.B. mit dem aus Beitrag #1:
HTML:
<style>
 h1 {
   font-family: 'Arial', serif;
   font-size: 2.3rem;
   color: #2233dd;
   letter-spacing: 0.1rem;
   margin: 0.5rem 0rem 0.5rem 0rem;
}
</style>
 
Zuletzt bearbeitet:
Ist zum ausprobieren gedacht, um ein Gefühl für CSS-Eigenschaften der Schrift-Gestaltung zu bekommen.

Alternativ in Firefox mit der rechten Maustaste die Überschrift anklicken und 'Element untersuchen' aus dem Popup-Menü auswählen. Dies öffnet den Inspektor der Web-Entwickler Tools und springt an die entsprechende Stelle in HTML. Auf der rechten Seite werden die Regeln zum Element angezeigt. Wird eine CSS-Eigenschaft verändert, wirkt sich dies sofort auf die Web-Seite aus. Einfach F5 drücken, falls was nicht passt und die Seite neu geladen werden soll.
letterbox schrieb:
Es geht um die h1 im Wort Fotografie. Sie hat momentan die gleiche Formatierung wie 'Herzlich willkommen' soll aber etwas anders sein (kleiner und evtl. andere Schriftart).
Fotografie hat die Klasse h2:
HTML:
<h1>Herzlich willkommen</h1>
. . .
<h2>Malerei</h2>
. . .
<h2>Fotografie</h2>

Aktuelle Darstellung:
Firefox_Inspektor_20180303.jpg
[Alter Screenshot entspricht aber dem aktuellen Stand.]
 
Zuletzt bearbeitet: (Ergänzung)
Hier mal der Quelltext:
HTML:
<!DOCTYPE html>
<html lang="de">
<head>
   <meta charset="utf-8">
   <title>Malerei2000</title>
   <meta name="description"Der Autor gibt Einblick in sein künstlerisches Schaffen;Malerei, Acrylmalerei Aquarelle "Platzhalter - Ein kurze Beschreibung des Inhalts in Satzform">
	<meta name="Keywords" content=Malerei, Acryl, Aquarelle>
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <!-- <link href="../css/zentrale.css" rel="stylesheet"> -->
   
   <style>

   /*Icon-Font - font-family: 'FontAwesome';*/
   @import url(http://fontawesome.io/assets/font-awesome/css/font-awesome.css);

   /*Überschriften - font-family: 'Roboto Slab', Serif;*/
   @import url(https://fonts.googleapis.com/css?family=Roboto+Slab);

   /*Fließtext - font-family: 'Roboto', Sans-Serif";*/
   @import url(https://fonts.googleapis.com/css?family=Roboto);

   /*Zahlen* - font-family: 'Merriweather';*/
   @import url(https://fonts.googleapis.com/css?family=Merriweather);

 
   /*Icon-Font - font-family: 'FontAwesome';*/
   @import url(http://fontawesome.io/assets/font-awesome/css/font-awesome.css);

   /*Überschriften - font-family: 'Roboto Slab', Serif;*/
   @import url(https://fonts.googleapis.com/css?family=Roboto+Slab);

   /*Fließtext - font-family: 'Roboto', Sans-Serif";*/
   @import url(https://fonts.googleapis.com/css?family=Roboto);

   /*Zahlen* - font-family: 'Merriweather';*/
   @import url(https://fonts.googleapis.com/css?family=Merriweather);

   /*Basisangaben*/
   @media all {
      header, nav, main, aside, footer, section, article, figure, figcaption, audio, video {
         display: block;
      }
      * {
         /*box-sizing: border-box;*/
         min-width: 1px;
      }
      html {
      }
      body {
         padding: 1rem 0.5rem 2rem 0.5rem;
         margin: 0rem 0rem 0rem 0rem;
      }
   }

   /*Schriften*/
   @media all {
      html {
         font-family: sans-serif;
         font-size: 120%;
         line-height: 1.3;
      }
      h1 {
         font-family: 'Felix titling', serif;
         font-size: 1.3rem;
		 color: #000000;
         letter-spacing: 0.1rem;
         margin: 0.5rem 0rem 0.5rem 0rem;
     
      }
      p, li, dl, dt, address {
         font-family: Roboto, sans-serif;
         font-size: 1rem;
         font-style: normal;
         margin: 0.5rem 0rem 0.5rem 0rem;
      }
      a {
         /*darkblue*/
         color: hsla(240, 100%, 27%, 1);
         text-decoration: none;
         outline: none;
         margin: 0rem 0rem 0rem 0rem;
      }
      figcaption {
         font-family: Roboto, sans-serif;
         font-size: 0.9rem;
         margin: 0rem 0rem 0rem 0rem;
      }
   }

   /*Grafiken*/
   @media all {
      figure {
         min-width: 1px;
         max-width: 100%;
         min-height: 1px;
         margin: 0,1rem;
      }
      img {
         min-width: 1px;
         display: block;
         max-width: 100%;
         /*max-height: 100vh;*/
         border: 0;
      }
   }

   /*Listen dl*/
   @media all {
      dl {
         margin: 0.5rem 0rem 0.5rem 0rem;
      }
      dt,
      dd {
      }
      dt {
         font-weight: bold;
         margin: 0rem 0rem 0rem 0rem;
      }
      dd {
         margin: 0rem 0rem 1rem 0rem;
      }
      dd p {
         margin: 0rem 0rem 0rem 0rem;
      }
   }

   /*body*/
   @media all {
      body {
      }
   }
   @media only screen and (min-width: 1000px) {
      body {
         display: flex;
         flex-wrap: wrap;
         justify-content: center;
      }
   }

   /*.pageheader*/
   @media all {
      .pageheader {
         background-color: #97FFFF;
         border: 1px solid black;
      }
      .pageheader h1 {
         text-align: center;
	   }
	   
   }
   @media only screen and (min-width: 1000px) {
      .pageheader {
         flex-grow: 0;
         flex-shrink: 0;
         flex-basis: calc(100% - 0rem - 2px - 0rem);
      }
   }

   /*.navigation*/
   @media all {
      .navigation ,.sidebar span.Stil1{
         background-color: #63B8FF;
         padding: 0.5rem;
         margin: 0.5rem 0rem;
      
   }
     a:hover{
    
}
   @media only screen and (min-width: 1000px) {
     .navigation a,.sidebar span.Stil1,
      .navigation a:visited {
         display: block;
         color: 	#483d8b;
         font-weight: bold;
         padding: 0.3rem;
         border: 1px solid black;
         border-radius: 0.3rem;
      }
     .sidebar span.Stil1:hover{
        background-color: black;
         color: gold;
       
     }
      .navigation a:hover,
      .navigation a:active,
      .navigation a:focus {
         background-color: black;
         color: gold;
	   }

   /*.content*/
   @media all {
      .content {
         background-color: #63B8FF;
         border: 2px solid black;
         padding: 0.5rem;
         margin: 0.5rem 0rem;
      }
      .content h2 {
         color: #FFFF33;
         text-align: center;
      }
      .content figure {
         max-width: 600px;
         margin: 0rem auto;
      }
   }
   @media only screen and (min-width: 1000px) {
      .content {
         margin: 0.5rem 1rem;
         flex-grow: 0;
         flex-shrink: 0;
         flex-basis: calc(100% - 250px - 250px - 1rem - 2px - 2rem);
      }
   }

   /*.sidebar*/
   @media all {
      .sidebar {
         background-color: #63B8FF;
		 color:	#483d8b;
		  font-weight: bold;
         padding: 0.5rem;
         border: 2px solid #63B8FF;
         margin: 0.5rem 0rem;
      }
   }
   @media only screen and (min-width: 1000px) {
      .sidebar {
         flex-grow: 0;
         flex-shrink: 0;
         flex-basis: calc(250px - 1rem - 4px - 0rem);
      }
   }

 
   /*.pagefooter*/
   @media all {
      .pagefooter {
         padding: 0.5rem;
         border: 2px solid black;
         margin: 0.5rem 0rem;
      }
   }
   @media only screen and (min-width: 1000px) {
      .pagefooter {
         background-color: #97FFFF;
         flex-grow: 0;
         flex-shrink: 0;
         flex-basis: calc(100% - 1rem - 4px - 0rem);
      }
   }

   /*Vorlagen zum Kopieren*/
   /*CSS*/
   @media all {
   }
   @media only screen and (min-width: 0px) {
   }
   @media only screen and (max-width: 0px) {
   }

   .Stil1 {color: #0000FF}
 

   .Stil1 {color: #0000FF}
   </style>
   <link rel="icon" type="image/vnd.microsoft.icon" href="www.guenter-leipfinger.de/favicon.ico">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body>
   <header class="pageheader">
      <h1>Herzlich willkommen</h1>
   </header>
   <nav class="navigation">
      
	   <p><a href="http://guenter-leipfinger.de/photoalben/photoalben.html">Photoalben</a></p>
     <p><a href="http://guenter-leipfinger.de/Kontakt.html">Kontakt</a></p>
      <p><a href="http://guenter-leipfinger.de/impressum.html">Impressum</a></p>
      <p><a href="http://gb.webmart.de/gb.cfm?id=1331502l" http:="" gb.webmart.de="">Gästebuch</a></p>
      <p>&nbsp;</p>
	   
	   <script type="text/javascript" src="https://whomania.com/count/k2p"></script>
	 
     <div align="center"><span><p style="font-size:12pt;">Letzte Aktualisierung:</p>
  <!--?php echo date("d.m.Y, H:i:s",filectime("index.php"));
?-->
    <script type="text/javascript">
document.write(new Date().getDatenew Date().getMonth()+1)+"."+new Date().getFullYear())
  </script>20.2.2018<p></p>

	  
   </span></div></nav>

	  
   </nav>
   
   <main class="content">
      
	   <center><h1>Fotografie</h1></center>
      <figure>
        <div align="center"><img src="http://guenter-leipfinger.de/libelle.jpg" alt="Fotografie" align="middle"></div>
      </figure>
      <footer class="contentfooter">      </footer>
   </main>
    
</body>

</html>

Es soll der Titel 'Fotografie' in Farbe, Schriftart und Größe geändert werden.
B I T T E
 
Zuletzt bearbeitet:
Es ist wie Cool Master im Beitrag #2 geschrieben hat, diese CSS-Rule (CSS-Regel):
HTML:
 h1 {
   font-family:  'Felix titling', serif;
   font-size: 2.3rem;
   color: #2233dd;
   letter-spacing: 0.1rem;
   margin: 0.5rem 0rem 0.5rem 0rem;
}
Er hat auch geschrieben, dass es den Font "Felix titling" nicht gibt, daher wird serif (Schriftart mit Serifen) verwendet.
letterbox schrieb:
Aktuell ein Blau-Ton: color: #2233dd;

Siehe auch unten im Screenshot auf der rechten Seite die Regel h1 Eigenschaft color.
letterbox schrieb:
Aktuell serif (Schriftart mit Serifen)
letterbox schrieb:
Aktuell font-size: 2.3rem

Dies drei CSS-Eigenschaften so ändern, dass das gewünschte Ergebnis erzielt wird. Sehr gut geht das mit dem Inspektor der Web-Entwickler Tools; Siehe Beitrag #11.

Screenshot oben Web-Seite unten der Inspektor - links HTML und rechts die (CSS-)Regeln:
Firefox_Inspector_20180306.jpg
 
Zuletzt bearbeitet: (Ergänzung)
DANKE
wo finde ich diesen Inspektor der Web-Entwickler Tools?
 
Am einfachsten mit einem Rechtsklick auf das Element der Web-Seite klicken (z.B. die Überschrift) und im Popup-Menü den Menü-Punkt 'Element untersuchen' auswählen.
Firefox_Inspector_inispect_element_20180306.jpg

Dies öffnet den Inspektor der Web-Entwickler Tools und springt an die entsprechende Stelle in HTML, wie im oberen Screenshot.

Hinweis:
Die Änderungen im Inspektor sind flüchtig und werden bei der Aktualisierung der Web-Seite überschrieben. Es ist nur für die direkte Beeinflussung der Web-Seite im Browser gedacht. Falls die Regel passt, müssen die Änderungen noch in die Sourcen der Web-Seite auf dem Web-Server übernommen werden.
 
Zuletzt bearbeitet: (Ergänzung)
Hauro schrieb:
Am einfachsten mit einem Rechtsklick auf das Element der Web-Seite klicken (z.B. die Überschrift) und im Popup-Menü den Menü-Punkt 'Element untersuchen' auswählen.
Anhang anzeigen 669804

Dies öffnet den Inspektor der Web-Entwickler Tools und springt an die entsprechende Stelle in HTML, wie im oberen Screenshot.

Da öffnet sich bei mir nur der Quick Tag Editor und der Code Navigator.
 
Der Inspektor kann auch über die Tastenkombination 'Strg+Shift+C' geöffnet werden. Im Inspektor muss dann das entsprechende Element selektiert werden - mit der Maus durch den DOM-Baum klicken.

P.S.
Gehe von Firefox als Browser aus.
 
Zuletzt bearbeitet:
Danke, auch im Browser! Trotzdem wo soll ich da die Schriftgröße einstellen?
 
Zurück
Oben