Skip to content
On this page
HTML und CSS
1

HTML

Hyper Text Markup Language

02.11.2022
HTML und CSS
2
02.11.2022
HTML und CSS
3

HTML

  • Dokumentbeschreibungssprache
  • Verschachtelte Element
  • <html> Tags
  • HTML DOM
02.11.2022
HTML und CSS
4

Markup

html
<html>
<head>
</head>
<body>
</body>
</html>
02.11.2022
HTML und CSS
5
  • CSS <style> ... </style>
  • Meta Informationen
  • Scripte (JS) <script src="./main.js"></script>
02.11.2022
HTML und CSS
6

Body

  • Verschachtelte Elemente
  • <h1>Titel</h1>
  • Images <img src="./hello.png">
  • Links <a href="../readme.html">Zum Readme</a>
  • Scripts
02.11.2022
HTML und CSS
7

Document

  • HTML ursprünglich als formatiertes Dokument
  • Hirarchisch strukturiert
  • Document Object Model (DOM)
02.11.2022
HTML und CSS
8

Webbrowser

  • Untersatz für jede Webseite
  • Interpretiert den DOM
  • Styles werden angewandt und Seite gerendert
  • Führt Javascript aus
02.11.2022
HTML und CSS
9

Inspect

02.11.2022
HTML und CSS
10

Cascading Style Sheets (CSS)

  • Wie wird das Dokument dargestellt?
  • CSS Selector für Regel
  • Regel definiert wie etwas dargestellt wird
02.11.2022
HTML und CSS
11

CSS Syntax

css
.description {
    width: 150px;
    font-weight: normal;
    color: green;
    background-color: #000;
}
02.11.2022
HTML und CSS
12

CSS Class Selector

  • HTML

    html
    <div class="description"></div>
    
  • CSS

    css
    .description {
        ...
    }
    
02.11.2022
HTML und CSS
13

Tag Selector

css
p {
    line-height: 140%;
}
02.11.2022
HTML und CSS
14

Descendant

css

.description > p {
    ...
}

02.11.2022
HTML und CSS
15

ID Selector

  • HTML

    html
    <div id="description"></div>
    
  • CSS

    css
    #description {
        ...
    }
    
02.11.2022
HTML und CSS
16

Inline CSS

html
<div style="font-size: 20px"></div>
02.11.2022
HTML und CSS
17

CSS Multiple Selectors same Rule

css
.box, .description {
    width: 150px;
    font-weight: normal;
    color: green;
    background-color: #000;
}
02.11.2022
HTML und CSS
18

CSS Priority

  • Mehrere Selectors beziehen sich auf das selbe Element
  • Priorität: je speziefischer desto höhere Priorität
  • Debugging mit Browser Inspect
02.11.2022
HTML und CSS
19

CSS Display

  • Block
  • Inline
  • Flex
  • Grid
  • None
02.11.2022
HTML und CSS

CSS Grid

20
02.11.2022
HTML und CSS

CSS Flex

21
02.11.2022
HTML und CSS
22

Media Query

css
@media(min-width: 600px) {
    .description {
        max-width: 1000px;
        font-size: 20px;
        background-color: #FFF;
        color: black;
    }
}
02.11.2022
HTML und CSS
23

Variablen

css
:root {
    --box-size: 20px;
    --main-color: red;
}
css
.description {
    color: var(--main-color);
}
02.11.2022
HTML und CSS
24

Responsive CSS

  • Content angepasst auf die Screen size
  • Mobile: Single Column Layout
  • @media Query hilft
  • Ohne JS möglich
02.11.2022
HTML und CSS
25

Transitions

  • Hübsche Darstellung / Animation
  • Demo
css
.button {
    ...
    transition: width 0.2s ease-in-out;
}

.button:hover {
    width: 500px;
}
02.11.2022
HTML und CSS
26
02.11.2022