lehrkraefte:blc:informatik:glf24:web:hello-css

This is an old revision of the document!


Aber mit Style bitte

CSS steht für Cascade style sheet.

Mit CSS kann das Aussehen bestimmter Elemente und ihrer Unterelemente (cascade!) festgelegt werden.

Elemente könne mit verschiedenen Selektoren ausgewählt werden.

/* Kommentare zwischen Slash Stern und Stern Slash */
h1 {  /* alle Übertitel <h1>...</h1> */
   color: white;          /* Textfarbe als Farbname */
   background: #002244;   /* Farbe als Hex-Code */
}
.wichtig {  /* Alle Elemente mit dem Attribut class="wichtig", z.B. <div class="wichtig">...</div> */
    font-weight: bold;  /* Fette Schrift */
}
#catpics {  /* Das (einzige!) Element mit id="catpics" */
    border-radius: 5px;
    border-style:solid;
    border-width: 2px;
    background-color:orange;
    margin:20px;
    padding:10px;
}
#catpics > div { /* Alle Div-Elemente, die direkt innerhalb des Elements mit id="catpics" sind. Aber nicht verschachtelte Unterlemente */
    display:flex;
    align-items: center;
    justify-content: space-evenly;
    flex-wrap: wrap;
}
  • lehrkraefte/blc/informatik/glf24/web/hello-css.1742985723.txt.gz
  • Last modified: 2025/03/26 10:42
  • by Ivo Blöchliger