HTML Basics

Grundlegendste Grundlagen!


Erstellen einer Website und die Implementierung derer Bilder:

Wenn man einfach nur eine Website ertsellen möchte, oder wenn man Bilder auf der Website angezeigt bekommen möchte, dann muss man erst mal einen Ordner erstellen. Es ist dabei völlig egal wie ihr den Ordner ertsellt. Ihr könnt den Ordner einfach direkt in Windows erstellen oder über die Entwicklungsumgebung, in diesem Fall Visual Code Studio. In diesem tut man dann einfach die HTML Datei rein, also einfach die, mit der man die Seite erstellt. Und dann, per Drag-and-Drop, tut man die Bilder, die man in dieser Seite sehen möchte, auch in diesem Ordner rein. Das wars.

HTML is Not Case Sensitive.
HTML tags are not case sensitive: <P> means the same as <p>.

The HTML element is everything from the start tag to the end tag:
<tagname>Content goes here...</tagname>

Examples of some HTML elements:
<h1>My First Heading</h1>
<p>My first paragraph.</p>

The <!DOCTYPE html> Declaration

The <!DOCTYPE> declaration represents the document type, and helps browsers to display web pages correctly.

It must only appear once, at the top of the page (before any HTML tags).

The <!DOCTYPE> declaration for HTML5 is: <!Doctype html>.

HTML Links

HTML links are defined with the <a> tag.
Example: <a href="https://www.w3schools.com">This is a link.</a>.

The link's destination is specified in the "href" attribute. And you have to use the "https://"" part, otherwise the links will not work.

This is a link. Dies ist auch ein Link.

Mal gucken ob dies geht. Los guck. Guck. Hier. Und? Hat's geklappt?

Das <img> Element

HTML images are defined with the <img> tag. The source file "src", alternative text "alt", "width", and "height" are provided as attributes.

Relevant <img> tag attributes:
"src" = source file
" alt" = alternative text
"width" = width
"height" = height

Will man ein Bild einfach nur vergrößern, dann braucht man einfach nur bei einem der Atrtribut-Werte "auto" eingeben.

The size of the following image is to large, so the propertys "width" and "height" had to be used to adjust the size.

So sieht der Code der pinken Blumen aus: <img src="Fresh-Pink-Blossoms.jpg" width="1380px" height="auto">
So sieht der Code vom Blumenbild aus: <img src="Blumen.png">

Natürlich kann man auch normale Links in den Wert des "src"Attributs schreiben, aber natürlich wäre das einfach nur hirnloser Müll, denn man hat über externe Bilder absolut keine Kontrolle. Und wenn dann auch noch irgendetwas nicht stimmt, dann kommt sowas hier raus: Kein Bild!!


HTML Attributes

All HTML elements can have attributes
Attributes provide additional information about elements
Attributes are always specified in the start tag
Attributes usually come in property/value pairs like: property="value"

The href Attribute

The <a> tag defines a hyperlink. The href attribute specifies the URL of the page the link goes to.
Here is an example: <a href="https://www.w3schools.com">Visit W3Schools</a>.

The src Attribute

The <img> tag is used to embed an image in an HTML page.
The src attribute specifies the path to the image to be displayed.
Here is an Example: <img scr="wooden-path-middle-forest.jpg">.

The style Attribute

The style attribute is used to add styles to an element, such as color:

This is a red paragraph.

Noch ein Paragraf. Aber diesmal normal.

Dieser aber mit Farbe!

Ohohohohohohohohoohooohoooooooooooohooooooooooooo!!!!!!!!!!!!!!!!!!!!!

So wird das style Attribut geschrieben, wenn man es z.B. in einem Paragrafen-Tag einfügt:

<p style="color:purple;">Heey!!!!</p>.

The lang Attribute

You should always include the lang attribute inside the <html> tag, to declare the language of the Web page. This is meant to assist search engines and browsers.

The lang attribute is written this way: <html lang="en"></html>

Country codes can also be added to the language code in the lang attribute, so the search engines can provide users more suitable results. So, the first two characters define the language of the HTML page, and the last two characters define the country.

Example: <html lang="en-US"></html>

The title Attribute

The title attribute defines some extra information about an element. The value of the title attribute will be displayed as a tooltip when you mouse over the element:

The title attribute is written this way: <p "title="This right now is a tooltip">A tooltip will appear.</p>.

A tooltip will appear.

Aber dieser Paragraf hat eine Farbe, und dann auch noch ein sogennantes Tooltip. OOOOOOOOOOOOOHHHHHHHHHHHHHHHOHOOOOOHHHHHHOOOOOO
HHHHHOOOOOOHHHOOOOOOOOOOOOOOOOOOO!!!!!!!!!!


HTML Headings

HTML Heading

HTML headings are defined with the <h1> to <h6> tags.
<h1> defines the most important heading. <h6> defines the least important heading.

Example: <h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>

Headings Are Important

Search engines use the headings to index the structure and content of your web pages. Users often skim a page by its headings. It is important to use headings to show the document structure. Don't use headings to make text bold. Only use it for headings.

You can change the size of a heading with the style attribute, using the font-size property.

Example: <h2 style="font-size:30px; color: rgb(128, 0, 0);">An Enlarged Header</h2>.

An Enlarged Header

Example: <h2 style="font-size:30px;" color:rgb(104, 0, 0);" title="HeeyHeey\^o^/">Another enlarged Header</h2>.

Another enlarged Header


Paragraphs

Paragraphs

A paragraph always starts on a new line, and is usually a block of text.
The HTML <p> element defines a paragraph.
A paragraph always starts on a new line, and browsers automatically add some white space (a margin) before and after a paragraph. No matter how spaces and line breaks you have added into the code.

Nur Mal eine Kleinigkeit zu Paragrafen. Es geht darum, dass Paragrafen automatisch voneinander getrennt werden, wenn mehrere im Quelltext nebeneinander geschrieben werden. Bedeutet also, Paragrafen fangen immer automatisch auf einer neuen Zeile an. Auch wenn die im Quelltext direkt nebeneinander stehen. Das bedeutet also, dass auf der Seite ein Paragraf immer getrennt von den anderen Paragrafen erscheint, so wie hier zu sehen ist.

Nur ein gewöhnlicher Paragraf.

Noch einer.

Und nochmal einer.

Was passiert jetzt?

Wie man sehen kann, wurde Paragraf einfach nach unten verschoben, obwohl genau dieser Paragraf im Quelltext direkt neben dem vorherigem steht.

Und noch was, selbst wenn ein langer Text im Quellcode oder Quelltext sehr lang ist, wird der lange Text im Browserfenster entsprechend angepasst, nicht so wie im Quelltext. Der Text wird also nicht so wie der im Quelltext steht, mit übertriebender Länge angezeigt. Selbst wenn man im Quelltext den Text sinnlos in viele Zeilen aufteilt oder sogar mit unnötig vielen Leerstellen Texte trennt, was rechtschreibmäßg völliger Blödsinn wäre, würde der Browser den Text am Ende richtig darstellen, und je nach Fenstergröße bzw. Auflösung, den Text entsprechend anpassen, sodass man immer, so wie jetzt, einen verfünftig angezeigten Text zu sehen bekommt.

HTML Horizontal Rules

The <hr> tag defines a thematic break in an HTML page, and is most often displayed as a horizontal rule. The <hr> element is used to separate content (or define a change) in an HTML page:

The thematic break element is written this way: <hr>. Like this:

HTML Line Breaks

The HTML <br> element defines a line break. Use the <br> tag if you want a line break (a new line) without starting a new paragraph:

Ein Paragraf. u_u
Und jetzt geht des Paragraf weiter. u_u
Und zum dritten. U_u
Und wieder. U_U

The HTML <pre> Element

The HTML <pre> element defines preformatted text.

The text inside a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks:

 Also der Text soll so angezeigt werden, wie der geschrieben wurde? Mal gucken.
     Und jetzt?
     Hey hey!
     Yo!!
    

HTML Styles

Font Familys

The CSS font-family property defines the font to be used for an HTML element:
Example: < p style="font-family:fantasy;">This is a paragraph</p>.

This is a paragraph.

This is a paragraph.

This is a paragraph.

This is a paragraph.

This is a paragraph.

Font Size

Hier geht es darum, Texte zu vergrößern. Dies geht mit dem style Attribut. Dazu fügt man das style Attribut in irgendein geeignetes Element hinein. Z.B. so:

<p style="font-size:40px;">Ein Paragraf.</p>.
<p style="font-size:400%;">Ein Paragraf.</p>.

This is a paragraph.

Ein Paragraf ist dies.

Dies auch.

Dies ist ein Paragraf mit 200% Vergrößerung.

Dieser verhältnismäßig kleine Paragraf hat eine 20-prozentige Vergrößerung. U_o

Centered Heading

Centered paragraph.

Paragraf in der Mitte.

Noch ein Paragraf in der Mitte.


Formating

HTML Formatting Elements Formatting elements were designed to display special types of text:

      <b> - Bold text
      <strong> - Important text
      <i> - Italic text
      <em> - Emphasized text
      <mark> - Marked text
      <small> - Smaller text
      <del> - Deleted text
      <ins> - Inserted text
      <sub> - Subscript text
      <sup> - Superscript text

HTML <b> and <strong> Elements

Die folgende Formatierung <b> wird dafür benutzt, damit Wörter in einer Aufzählung mehr Aufmerksamkeit geschenkt werden kann. Hier mal ein Beispiel; In Deutschland gibt es drei Arten von Schulen: Hauptschule, Realschule und Gymnasium.

Die folgende Formatierung <strong> wird benutzt, um etwas wirklich sehr wichtiges hervorzuheben. Hier mal ein Beispiel; Das folgende Prinzip ist von immenser Wichtigkeit: Immer im vorraus nachdenken, bevor man etwas sagt oder tut!

HTML <i> and <em> Elements

Die folgende Formatierung <i> ist im eigentlichen Sinne informativ, zum Beispiel kann die Verwendung so aussehen; Das beiden größten Schlachtschiffe, die die Japaner jemals gebaut haben, waren die Yamato und die Musashi. Oder; Die beiden größten Schlachtschiffe, welche die Deutschen jemals gebaut haben, waren die Bismarck und die Tirpitz.

Hier wird etwas hervorgehoben, und zwar diese unfassbar schönen Wörter: eloquence, prestine, und quintessential

HTML <small> Element

Dies ist dazu da um zum Beispiel so etwas wie copyright anzuzeigen.

HTML <mark> Element

Do not forget to buy <mark>soya milk</mark> today.

Do not forget to buy soya milk today

HTML <del> Element

The HTML <del> element defines text that has been deleted from a document. Browsers will usually strike a line through deleted text:

Die schönste Farbe der Welt ist Silber Gold.

HTML <ins> Element

The HTML <ins> element defines a text that has been inserted into a document. Browsers will usually underline inserted text:

Die schönste Farbe der Welt ist Silber Gold.

HTML <sub> Element

The HTML <sub> element defines subscript text. Subscript text appears half a character below the normal line, and is sometimes rendered in a smaller font. Subscript text can be used for chemical formulas, like H2O.

HTML <sup> Element

Schöne Luxusvillen haben im Schnitt 300m2 Wohnfläche.


Quotations

All about <blockquote>, <q>, <abbr>, <address>, <cite>, and <bdo> HTML elements.

HTML <blockquote> for Quotations

The HTML <blockquote> element defines a section that is quoted from another source. Browsers usually indent <blockquote> elements.

Hier mal ein Beitrag über geplante Obsoleszenz:

Wie viele Strumpfhosen kann ein Unternehmen schliesslich verkaufen, wenn diese ein Leben lang halten? Mogelt sich jedoch mit ziemlicher Sicherheit nach kurzer Zeit ein Riss in deine Nylonstrümpfe, musst du regelmässig für Nachschub sorgen. Genauso kennen wir es von Smartphone-Akkus, Software, Sollbruchstellen an Ladekabeln, sich lösenden Schuhsohlen, … Die Liste geht endlos weiter.

Und hier ein Beitrag über das berüchtigte Van-Eck-Phreaking:

It's untraceable and requires access to neither your computer nor your network. And it can give a hacker a picture of what you're doing on your PC. It's called Van Eck Phreaking, and it sounds terrifying. But is it really a threat?

In 1985, Dutch computer scientist Wim Van Eck published a proof of concept detailing a frightening new kind of eavesdropping. Using nothing more than a television and $15 worth of equipment, he was able to eavesdrop on a computer system several hundred meters away. He required neither physical access to the system nor remote access to the network on which it operated.

This attack vector came to be known as Van Eck Phreaking, and it's still present to this day. Modern LCD displays emit electromagnetic radiation as well, and as such are just as vulnerable as old-style CRTs. The good news is that the equipment requires costs significantly more than Van Eck’s original gear, running at approximately $2,000.

Unlike most forms of intrusion, Van Eck Phreaking is completely untraceable. There is no way to determine if you’re being targeted by it. And the only way to defend yourself against it is through techniques such as metallic walls, video signal scramblers, and custom laptop batteries.

It gets worse. As reported by tech publication Ars Technica, a similar attack, known as Synesthesia, uses remote audio recording and machine learning to reconstruct the contents of a display. This all sounds rather frightening, doesn’t it?

Short Quotations

Browsers usually insert quotation marks around the <q> element.

WWF's goal is to: Build a future where people live in harmony with nature.

Albert Einstein sagte: Der wirkliche Wert eines Menschen ist es, ein gutes Wesen zu besitzen.

Nikola Tesla sagte eins: Wenn du die Geheimnisse des Universums verstehen willst, dann denke in Energie, Frequenz und Schwingung.

Wir sind die COOOOOOOOOOOOLLLLSSSSTEEEEEEEEEEEN!!!!!!!!!!! und die BESTEEEEEEEEEEEEEEEN!!!!!!!!!!!

Wir sind UNENDLICH SCHLAU!!!!!!!!!!!

Wir sind UNFEHLBAR und PERFEKT und 1000-Mal schlauer, als alle existierenden Wesen im Universum zusammen!

Abbreviations

The WHO was founded in 1948.

Marking up abbreviations can give useful information to browsers, translation systems and search-engines.

An abbreviation is a shortened form of a word or phrase, by any method. Z.B. ist die Abkürzung von vehicle identification nummber VIN. Oder die Abkürzung VIP bedeutet very important person.

Address Element

The HTML <address> element defines contact information (author/owner) of a document or article.

Written by John Doe.
Visit us at:
Example.com
Box 564, Disneyland
USA

HeyheyHeyheyHeyheyHeyheyHeyheyHeyheyHeyheyHeyheyHeyheyHeyheyHeyheyHeyheyHeyheyHeyheyHeyheyHeyheyHeyheyHeyheyHeyheyHeyhey

Written by Baba Wawa.
11111, Fantasieland
Fantasiewelt

Cite Element

The HTML cite element defines the title of a work (e.g. a book, a poem, a song, a movie, a painting, a sculpture, etc.).

Browsers usually display cite elements in italic.

Das Werk Out of Body ist ein sehr interessantes und nützliches Werk.

Bi-Directional Override

BDO stands for Bi-Directional Override.

Original:
This line will be written from right to left.
This line is also mirrored, just like the previous one.

Bi-Directional Override:
This line will be written from right to left.
This line is also mirrored, just like the previous one.
Das Attribut "dir" bedeutet einfach nur direction. "rtl" bedeutet right to left und "ltr" bedeutet left to right.
Der Begriff "override" im Zusammenhang mit dem <bdo> Element in HTML bezieht sich darauf, dass die
standardmäßige Textausrichtung überschrieben oder außer Kraft gesetzt wird."bi-" kommt ursprünglich vom
lateinischen und bedeutet "doppelt, zwei haben", welches mit dem griechischen di- "two" verwandt ist.

Comments

In diesem Teil geht es um Kommentare. Die sind aber nur im Quellcode sichtbar. Jetzt also sieht man auf der Seite nichts.
Manche Dinge also sind in diesem Abschnitt nur im Quellcode sichtbar. Kommentare schreibt man im Quellcode z.B. so: <!-- Heyhey! U_u Yo! O_u -->.
Oder so: <!-- Es existieren wirkliche Wunder, wie freie Energie. :-O Daran muss man forschen :-D -->

Hidden Content

Comments can be used to hide content.
This can be helpful if you hide content temporarily:

Den nächsten Paragrafen wird man also nur im Quellcode sehen. U_U

Mit Kommentaren kann man also Inhalte verstecken.

Hide multiple contents

You can also hide more than one line. Everything between the <!-- and the --> will be hidden from the display.

Comments are also great for debugging HTML, because you can comment out HTML lines of code, one at a time, to search for errors.

Hide Inline Content

Comments can be used to hide parts in the middle of the HTML code.

Jetzt gleich wird ein Wort versteckt.
HeeyHeeyHeey. :D
Welches Wort wurde hier wohl versteckt? :O
"Heey" wurde versteckt. :O


Colors

Man kann Hintergrundfarben von Elementen ändern. U_U
Das geht mit folgendem Syntax: <p style="background-color: gold;">Ein Paragraf mit Hintergrundfarbe.</p>.

Eeey U_u... Hier ist ein mit farblichen Hintergrund zitierter Text. Dort geht es um die neuen Smartphones der Samsung Galaxy S-Reihe:

Prozessor: Ist neuer auch besser?

Den Stand Frühjahr 2024 schnellsten Android-Chipsatz Snapdragon 8 Gen 3 von Qualcomm gönnt Samsung hierzulande nur dem Topmodell S24 Ultra. Das normale Galaxy S24 wird in Europa dagegen mit dem brandneuen Samsung-Prozessor Exynos 2400 verkauft, während S23 (wie das S23 Ulta) bei Erscheinen noch mit dem Anfang 2023 führenden Snapdragon 8 Gen 2 for Galaxy ausgestattet ist. Mit dem Exynos 2400 kann das S24 nicht ganz mit seinem Ultra-Verwandten mithalten. In vielen Testpunkten liegt es kaum vor dem S23.

Jetzt wird kurz etwas aus einer Seite zitiert, wo es um Pythagoras und die Entdeckung der 432-Hz-Frequenz geht:

Pythagoras und die Entdeckung der 432-Hz-Frequenz

Der berühmte griechische Philosoph und Mathematiker Pythagoras spielte eine entscheidende Rolle bei der Entdeckung der 432-Hz-Frequenz. Er erkannte die harmonischen Beziehungen zwischen Zahlen und Tönen und entwickelte die Pythagoreische Stimmung, bei der die 432 Hz als Grundfrequenz verwendet wurde. Pythagoras glaubte, dass diese Frequenz eine tiefgreifende Wirkung auf die menschliche Psyche hatte und zur spirituellen Entwicklung beitrug.

Text Color

Und die Textfarbe kann man ebenfalls ändern. U_U

Hier gibt es ein interessantes Blockzitat über die 432-Hz-Frequenz:

Erhöhte Konzentration und Kreativität

Die 432-Hz-Frequenz kann auch Ihre kognitiven Fähigkeiten verbessern. Viele Menschen berichten von einer gesteigerten Konzentration und Kreativität, wenn sie Musik in dieser Frequenz hören. Dies kann Ihnen in Ihrer Arbeit, beim Lernen oder bei kreativen Projekten zugutekommen.

Hier gibt es noch mal einen interessanten, zitierten Beitrag über die 432-Hz-Frequenz:

Emotionale Heilung und Wohlbefinden

Musik in 432 Hz hat das Potenzial, emotionale Blockaden zu lösen und das allgemeine Wohlbefinden zu steigern. Es kann Ihnen helfen, negative Emotionen loszulassen und ein tieferes Gefühl von innerem Frieden und Glück zu finden.

Border Color

You can set the color of borders:

Dies ist ein Text mit einem farblichen Rand.

Dieser Text hat auch einen farblichen Rand, der den Text umgibt.

Noch ein Paragraf mit farblichen Rand. u_u

Jetzt sieht man hier einen Text, der erklärt, wie das style Attribut mit dem Rand überhaupt funktioniert. Wie man sehen kann, schreibt man mit dem "style" Attribut die Umrandung. Z.B. so: <p style="border: solid;"> Hier mal ein Paragraf.</p>. Das "solid" beschreibt das Aussehen der Umrandung. Jetzt gerade ist die einfach nur normal wie man sehen kann. Wenn man das Beispiel kopiert und einfügt, dann sieht es einfach nur so aus wie jetzt. Wenn man aber die Dichte ändern will und eine Farbe hinzufügen will, dann muss man neben dem "solid" die Pixeldichte "px" hinzufügen und dann die Farbe. Wenn man mit dem normalen Standard-Rand zufrieden ist, lässt man die Dichte in "px neben dem "solid" einfach weg und schreibt einfach nur neben dem CSS-Wert, also in diesem Fall das "solid", die gewünschte Farbe hin. Das könnte z.B. so aussehen: <p style="border: solid crimson;">Ein Paragraf mit einem purpuren Rand.</p>. Der nächste Paragraf wird genau dieser sein.

Ein Paragraf mit einem purpuren Rand.


Color Values

Same as color name "maroon":

rgb(128, 0, 0)

#800000

hsl(0, 100%, 25%)

Same as color name "maroon", but 50% transparent:

rgba(128, 0, 0, 0,5)

hsla(0, 100%, 25%, 0,5)

In addition to the predefined color names, colors can be specified using RGB, HEX, HSL, or even transparent colors using RGBA or HSLA color values.

RGB steht für "Rot, Grün, Blau". Aus diesen drei Farben werden alle anderen Farben gemischt und hergestellt. HSL hingegen steht für Hue, Saturation, Lightness. Auf Deutsch also steht das HSL für Farbton, Sättigung, Helligkeit.


HTML Styles - CSS

CSS stands for Cascading Style Sheets.

CSS saves a lot of work. It can control the layout of multiple web pages all at once.

Cascading Style Sheets (CSS) is used to format the layout of a webpage. With CSS, you can control the color, font, the size of text, the spacing between elements, how elements are positioned and laid out, what background images or background colors are to be used, different displays for different devices and screen sizes, and much more!

Tip: The word cascading means that a style applied to a parent element will also apply to all children elements within the parent. So, if you set the color of the body text to "blue", all headings, paragraphs, and other text elements within the body will also get the same color (unless you specify something else)!

Using CSS

CSS can be added to HTML documents in 3 ways:


Inline - by using the style attribute inside HTML elements
Internal - by using a <style> element in the <head> section
External - by using a <link> element to link to an external CSS file

The most common way to add CSS, is to keep the styles in external CSS files. However, in this tutorial we will use inline and internal styles, because this is easier to demonstrate, and easier for you to try it yourself.

Inline CSS

An inline CSS is used to apply a unique style to a single HTML element.

An inline CSS uses the style attribute of an HTML element.

The following example sets the text color of the <p> element to deep pink, and the text color of the <abbr> element to rose gold:

Deep Pink is a nice color.

Das Wort Laser steht für: Light Amplification by Stimulated Emission of Radiation.

So sehen die Codes für die beiden Paragrafen davor aus:
<p style="color:deeppink;">Deep pink is a nice color.<p>
<p>Das Wort <abbr title="Light Amplification by Stimulated Emission of Radiation" style="color:gold">Laser<abbr> steht für: <i>Light Amplification by Stimulated Emission of Radiation</i>.

Internal CSS

An internal CSS is used to define a style for a single HTML page.

An internal CSS is defined in the <head> section of an HTML page, within a <style> element.

The following example of the HTML section sets the text color of ALL the <h1> elements (on that page) to maroon, and the text color of ALL the <p> elements to gold. In addition, the page will be displayed with a "beige" background color:

<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: beige;}
h1   {color: maroon;}
p    {color: gold;}
</style>
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

External CSS

An external style sheet is used to define the style for many HTML pages.

To use an external style sheet, add a link to it in the <head> section of each HTML page:

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
   
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
   
</body>
</html>

The external style sheet can be written in any text editor.
The file must not contain any HTML code, and must be saved with a .css extension.
Here is what the "styles.css" file looks like:

body {background-color: beige;}
h1   {color: maroon;}
p    {color: gold;}

Tip: With an external style sheet, you can change the look of an entire web site, by changing one file!

CSS Colors, Fonts and Sizes

Here, we will demonstrate some commonly used CSS properties. You will learn more about them later.

The CSS color property defines the text color to be used.

The CSS font-family property defines the font to be used.

The CSS font-size property defines the text size to be used.

   <!DOCTYPE html>
   <html>
   <head>
   <style>
   h1   {color: maroon;font-family:fantasy; font-size:40px;}
   p    {color: gold;font-family:fantasy; font-size:40px;}
   </style>
   </head>
   <body>
   
   <h1>This is a heading</h1>
   <p>This is a paragraph.</p>
   
   </body>
   </html>
   

CSS Border

The CSS border property defines a border around an HTML element.

Tip: You can define a border for nearly all HTML elements.

So kann es aussehen:

p  {border:solid 2px purple}

CSS Pading

The CSS padding property defines a padding (space) between the text and the border.

Also nochmal auf Deutsch. Das CSS Padding sind die Wattepads zwischen den "Borders", also zwischen den Rändern. Man packt weiche Wattepads zwischen den Ränddern, sonst nichts. Natürlich funktionieren die nur mit dem entsprechendem Element, in diesem Fall der Rand.

So würde dies aussehen:

   <!DOCTYPE html>
   <html>
   <head>
   <style>
   h1   {border:solid 1px gold; padding:40px;}
   p    {border:solid 1px purple; padding:40px;}
   </style>
   </head>
   <body>
   
   <h1>This is a heading</h1>
   <p>This is a paragraph.</p>
   
   </body>
   </html>   

CSS Margin

The CSS margin property defines a margin (space) outside the border.

So würde dies aussehen:

   <!DOCTYPE html>
   <html>
   <head>
   <style>
   h1   {border:solid 1px gold; padding:40px;margin:40px;}
   p    {border:solid 1px purple; padding:40px;margin:40px;}
   </style>
   </head>
   <body>
   
   <h1>This is a heading</h1>
   <p>This is a paragraph.</p>
   
   </body>
   </html>

Link to External CSS

External style sheets can be referenced with a full URL or with a path relative to the current web page.

This example uses a full URL to link to a style sheet:

   <!DOCTYPE html>
   <html>
   <head>
   <link rel="stylesheet" href="https://www.w3schools.com/html/styles.css">
   
   </head>
   <body>
   
   <h1>This is a heading</h1>
   <p>This is a paragraph.</p>
   
   </body>
   </html>

This example links to a style sheet located in the html folder on the current web site:

   <!DOCTYPE html>
   <html>
   <head>
   <link rel="stylesheet" href="/html/styles.css">
   
   </head>
   <body>
   
   <h1>This is a heading</h1>
   <p>This is a paragraph.</p>
   
   </body>
   </html>

This example links to a style sheet located in the same folder as the current page:

   <!DOCTYPE html>
   <html>
   <head>
   <link rel="stylesheet" href="styles.css">
   
   </head>
   <body>
   
   <h1>This is a heading</h1>
   <p>This is a paragraph.</p>
   
   </body>
   </html>

Nebenbei gelernt

Hier nur mal ein paar Sachen, welche man nebenbei so gelernt hat.

Das <title> Element

Das <title> Element wird benutzt, um den Titel einer Website auf dem Tab anzeigen zu können.

Dieses Element wird folgender Maßen verwendet:

<!DOCTYPE html>
<html>
<head>
<title>HTML lernen</title>
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

Wie man sehen kann, heißt der Titel der Seite "HTML lernen". Und so wird das auf dem Tab anngezeigt, wenn man die Seite öffnet.

Lange Wörter an Anzeige anpassen

Wenn ein Wort übertrieben lang ist, dann wird die Website sehr weit in die Länge gedehnt. Dies kann manchmal schlecht aussehen oder einfach nur nerven. Deswegen gibt es genau dafür eine Lösung.

So sieht der Syntax aus: style="word-wrap: break-word;"

Javascript

Hier geht es jetzt um Javascript.


HTML Links

Links are found in nearly all web pages. Links allow users to click their way from page to page.

HTML Links - Hyperlinks

HTML links are hyperlinks.

You can click on a link and jump to another document.

When you move the mouse over a link, the mouse arrow will turn into a little hand.

Note: A link does not have to be text. A link can be an image or any other HTML element!

Die Definition von Hyperlinks:

Der Begriff "Hyperlink" setzt sich aus den Wörtern "Hypertext" und "Link" zusammen. Der Begriff wurde geprägt, um eine spezielle Art von Verbindung oder Verweis zwischen verschiedenen Teilen von Hypertextdokumenten zu beschreiben. Der Zusatz "Hyper-" kommt von "Hypertext", einer Technologie, die die nicht-lineare Verknüpfung von Texten ermöglicht.

Hypertext: Der Begriff "Hypertext" bezieht sich auf eine nicht-lineare Struktur von Texten, bei der Informationen in Form von verknüpften Texten organisiert sind. Ein Hypertextdokument enthält Links oder Verknüpfungen, die es dem Benutzer ermöglichen, von einem Textpunkt zu einem anderen zu springen.

Link: Der Begriff "Link" bezeichnet im Allgemeinen eine Verbindung oder Verknüpfung zwischen zwei Ressourcen. In Bezug auf Hypertext bezieht sich ein "Link" auf eine spezielle Art von Verbindung, die es ermöglicht, von einem Hypertextdokument zu einem anderen oder zu einer anderen Ressource zu springen.

Zusammen ergibt sich der Begriff "Hyperlink" als eine spezielle Art von Link, die in einem Hypertextdokument verwendet wird. Der Hyperlink ermöglicht es dem Benutzer, von einem Punkt im Text zu einem anderen zu navigieren, indem er auf den Link klickt. Der Begriff wurde besonders populär und verbreitet, als das World Wide Web (WWW) aufkam und Hyperlinks zu einem grundlegenden Bestandteil der Navigation im Internet wurden.

Die Definition von Hypertexten:

Die nicht-lineare Verknüpfung von Texten im Hypertext ermöglicht es, Informationen auf eine Weise zu präsentieren, die über die traditionelle lineare Darstellung von Texten hinausgeht. In einer linearen Darstellung würde der Leser den Text von Anfang bis Ende in einer festgelegten Reihenfolge lesen, ohne die Möglichkeit, direkt zu anderen Teilen des Textes zu springen.

Im Gegensatz dazu erlaubt der Hypertext, dass Informationen nicht-linear präsentiert werden:

Verknüpfungen und Hyperlinks: Innerhalb eines Hypertextdokuments oder einer Webseite können Hyperlinks erstellt werden, die es dem Benutzer ermöglichen, von einem Abschnitt zu einem anderen zu springen. Zum Beispiel könnte ein Wort in einem Text als Link zu einer Definition, einer weiteren Seite oder sogar zu einer externen Website dienen. Dies ist ähnlich zu dem, was auf Plattformen wie Wiktionary oder anderen Hypermedia-Plattformen zu finden ist.

Mehrere Zugangspunkte: Hypertext ermöglicht es, dass ein Thema von verschiedenen Stellen aus erreicht werden kann. Statt von vorne nach hinten zu lesen, kann der Benutzer direkt zu einem relevanten Abschnitt springen. Dies bietet mehrere Zugangspunkte zu Informationen, was besonders nützlich ist, wenn der Benutzer spezifische Fragen hat oder sich nur für bestimmte Aspekte eines Textes interessiert.

Nicht-lineare Struktur: Hypertextdokumente können eine nicht-lineare Struktur haben, die durch Verknüpfungen und Hierarchien von Informationen gekennzeichnet ist. Der Benutzer hat die Freiheit, durch den Text zu navigieren, um Verbindungen zu erkunden und Informationen auf eine Art und Weise abzurufen, die seiner eigenen Neugier oder seinen spezifischen Interessen entspricht.

Das World Wide Web, das auf dem Konzept des Hypertexts basiert, bietet ein ausgezeichnetes Beispiel für die nicht-lineare Darstellung von Informationen, bei der Benutzer mithilfe von Hyperlinks von einer Webseite zur anderen springen können. Dies ermöglicht eine effiziente und vielseitige Informationsbeschaffung im Vergleich zu traditionellen linearen Textformaten.

Die kurze und einfache Definition von linearen- und nicht-linearen Texten:

Linearer Text: Ein linearer Text ist eine abfolgende, strukturierte Darstellung von Informationen, bei der der Leser den Text von Anfang bis Ende in einer festgelegten Reihenfolge liest. Es gibt keine direkten Verknüpfungen oder Sprünge zu anderen Teilen des Textes, und die Informationen werden auf eine traditionelle, sequenzielle Weise präsentiert.

Nicht-linearer Text (Hypertext): Ein nicht-linearer Text oder Hypertext ist eine nicht-sequenzielle, strukturierte Darstellung von Informationen, die durch Verknüpfungen und Hyperlinks miteinander verbunden ist. Der Leser kann nicht-linear navigieren, indem er von einem Abschnitt zu einem anderen springt. Es gibt mehrere Zugangspunkte zu Informationen, und die Struktur ermöglicht es, dass Themen auf verschiedene Weisen erkundet werden können.

Lineare Texte sind also traditionelle Texte, die man von Anfang bis Ende ließt.

HTML Links - Syntax

The HTML <a> tag defines a hyperlink. It has the following syntax:

<a href="url">link text</a>

The most important attribute of the <a> element is the href attribute, which indicates the link's destination.

The link text is the part that will be visible to the reader.

Clicking on the link text, will send the reader to the specified URL address.

This example shows how to create a link to www.karstadt.de:

<a href="https://www.karstadt.de">Link</a>
Link

By default, links will appear as follows in all browsers:

An unvisited link is underlined and blue
A visited link is underlined and purple
An active link is underlined and red
Tip: Links can of course be styled with CSS, to get another look!

HTML Links - The target Attribute

By default, the linked page will be displayed in the current browser window. To change this, you must specify another target for the link.

The target attribute specifies where to open the linked document.

The target attribute can have one of the following values:

_self - Default. Opens the document in the same window/tab as it was clicked
_blank - Opens the document in a new window or tab
_parent - Opens the document in the parent frame
_top - Opens the document in the full body of the window

Absolute URLs vs. Relative URLs

Both examples above are using an absolute URL (a full web address) in the href attribute.

A local link (a link to a page within the same website) is specified with a relative URL (without the "https://www" part):

   Absolute URLs:
   <a href="https://www.w3.org/">W3C</a>
   <a href="https://www.google.com/">Google</a>
   
   Relative URLs:
   <a href="html_images.asp">HTML Images</a>
   <a href="/css/default.asp">CSS Tutorial</a>

HTML Links - Use an Image as a Link

To use an image as a link, just put the <img> tag inside the <a> tag:


City at night

Link to an Email Address

Use mailto: inside the href attribute to create a link that opens the user's email program (to let them send a new email):

<a href="mailto:gumamila@live.de">Send email</a>
Email senden

Button as a Link

To use an HTML button as a link, you have to add some JavaScript code.

JavaScript allows you to specify what happens at certain events, such as a click of a button:

Example:

<button onclick="document.location='default.asp'">HTML Tutorial</button>

Link Titles

The title attribute specifies extra information about an element. The information is most often shown as a tooltip text when the mouse moves over the element.

Example:

<a href="https://www.w3schools.com/html/" title="Go to W3Schools HTML section">Visit our HTML Tutorial</a>

Visit our HTML Tutorial

More on Absolute URLs and Relative URLs

Example:

Use a full URL to link to a web page:

   <a href="https://www.w3schools.com/html/default.asp">HTML tutorial</a>
Example:

Link to a page located in the html folder on the current web site:

   <a href="/html/default.asp">HTML tutorial</a>
Example:

Link to a page located in the same folder as the current page:

   <a href="default.asp">HTML tutorial</a>

HTML Links - Different Colors

An HTML link is displayed in a different color depending on whether it has been visited, is unvisited, or is active.

Geh in die andere Datei gucken. Die Datei lautet "cc".

Link Buttons

Klick auf den Button um mehr zu erfahren.

HTML Links - Create Bookmarks

HTML links can be used to create bookmarks, so that readers can jump to specific parts of a web page. Oder einfach gesagt man erstellt eine Verankerung oder eine Verknotung wenn man so will.

Create a Bookmark in HTML

Bookmarks can be useful if a web page is very long.
To create a bookmark - first create the bookmark, then add a link to it.
When the link is clicked, the page will scroll down or up to the location with the bookmark.

First, use the id attribute to create a bookmark(oder eines von den beiden Teilen der Verknotung):

<h2 id="C4">Chapter 4</h2>

Then, add a link to the bookmark ("Jump to Chapter 4"), from within the same page:

<a href="#C4">Jump to Chapter 4</a>

You can also add a link to a bookmark on another page:

<a href="html_demo.html#C4">Jump to Chapter 4</a>

HTML Images

Hier geht es um Bilder.

Image Floating und so

HTML Image Maps