Einführung in das HTML-Layout

Beim Entwerfen einer Webseite ist es wichtig, dass wir die Webseitenelemente auf elegante Weise anordnen. Sie sollten für den Benutzer leicht zu navigieren und einfach sein. Das HTML-Layout bietet eine Möglichkeit, diese Elemente strukturiert anzuordnen. Das HTML-Layout verleiht der Webseite ein sehr gutes Aussehen und bietet auch eine einfache Möglichkeit zum Entwerfen. HTML-Layout ist eine einfache Methode, mit der wir Webelemente mit einfachen Standard-HTML-Tags entwerfen können. HTML bietet verschiedene Layoutelemente, mit denen wir verschiedene Teile der Webseite gestalten können.

HTML-Layoutelemente

In diesem Artikel sehen wir verschiedene HTML-Layout-Elemente mit ihren Beispielen. Wir werden eine einfache Struktur ähnlich der Zeitung entwerfen, indem wir diese Elemente verwenden.

1.

Dieses Element wird verwendet, um den Header der Webseite zu definieren. Es enthält den Titel der Seite oder ein Logo oder einen einführenden Inhalt.

Code :



EduCba

Header Section



EduCba

Header Section



EduCba

Header Section

Ausgabe :

2.

Dieses Element enthält Links zur Menüliste. Dieses Element ist wie ein Container für verschiedene Navigationslinks. Die Links befinden sich auf einer anderen Seite oder auf derselben Seite.

Code :

Fügen wir ein Navigationselement direkt unter der Überschrift aus unserem letzten Beispiel hinzu. Fügen Sie einen Teil in das Element und einen Teil direkt unter dem Kopfbereich ein.


li(
display: inline-flex;
padding: 25px
)
ul(
text-align: center;
)


Navigation Link1
Navigation Link2
Navigation Link3


    li(
    display: inline-flex;
    padding: 25px
    )
    ul(
    text-align: center;
    )


    Navigation Link1
    Navigation Link2
    Navigation Link3


  • li(
    display: inline-flex;
    padding: 25px
    )
    ul(
    text-align: center;
    )


    Navigation Link1
    Navigation Link2
    Navigation Link3


  • li(
    display: inline-flex;
    padding: 25px
    )
    ul(
    text-align: center;
    )


    Navigation Link1
    Navigation Link2
    Navigation Link3


  • li(
    display: inline-flex;
    padding: 25px
    )
    ul(
    text-align: center;
    )


    Navigation Link1
    Navigation Link2
    Navigation Link3


  • li(
    display: inline-flex;
    padding: 25px
    )
    ul(
    text-align: center;
    )


    Navigation Link1
    Navigation Link2
    Navigation Link3


  • li(
    display: inline-flex;
    padding: 25px
    )
    ul(
    text-align: center;
    )


    Navigation Link1
    Navigation Link2
    Navigation Link3


  • li(
    display: inline-flex;
    padding: 25px
    )
    ul(
    text-align: center;
    )


    Navigation Link1
    Navigation Link2
    Navigation Link3


li(
display: inline-flex;
padding: 25px
)
ul(
text-align: center;
)


Navigation Link1
Navigation Link2
Navigation Link3

Ausgabe :

3.

Dieses Element ähnelt dem Hauptabschnitt der Webseite. Es kann jede Art von Information enthalten. Es kann Text, Bilder usw. enthalten.

4.

Wie der Name schon sagt, enthält dieses Element einen Inhalt wie einen Absatz, eine detaillierte Beschreibung von etwas oder irgendeine Art von Information. Im Allgemeinen ist dies der Hauptteil, der Informationen auf einer Webseite enthält.

5.

Dieses Element definiert den Inhalt, der sich neben dem Hauptinhalt wie Abschnitt oder Artikel befindet. Dieses Informationselement ist optional und enthält im Allgemeinen zusätzliche Informationen oder Werbeinhalte.

Code :

Fügen wir alle drei Elemente unterhalb der Navigationsleiste zusammen.


li ( display: inline-flex;
padding: 25px
)
section(
background-color: #607D8B;
width: 79%;
position: absolute;
height: 150px;
)
article(
width: 79%;
background-color: #607d8b70;
position: absolute;
top: 368px;
height: 150px;
)
aside(
background-color: #607d8b99;
width: 20%;
position: absolute;
left: 80%;
height: 300px;
)
h2, p (
text-align: center;
color: #9c27b0;
)
ul(
text-align: center;
)


Section Part


li ( display: inline-flex;
padding: 25px
)
section(
background-color: #607D8B;
width: 79%;
position: absolute;
height: 150px;
)
article(
width: 79%;
background-color: #607d8b70;
position: absolute;
top: 368px;
height: 150px;
)
aside(
background-color: #607d8b99;
width: 20%;
position: absolute;
left: 80%;
height: 300px;
)
h2, p (
text-align: center;
color: #9c27b0;
)
ul(
text-align: center;
)


Section Part


li ( display: inline-flex;
padding: 25px
)
section(
background-color: #607D8B;
width: 79%;
position: absolute;
height: 150px;
)
article(
width: 79%;
background-color: #607d8b70;
position: absolute;
top: 368px;
height: 150px;
)
aside(
background-color: #607d8b99;
width: 20%;
position: absolute;
left: 80%;
height: 300px;
)
h2, p (
text-align: center;
color: #9c27b0;
)
ul(
text-align: center;
)


Section Part

Etwas Text



Artikel Teil


Etwas ausführlicher Text


Teil der Seitenleiste


Dies wird statischen Teil oder irgendetwas wie Werbung usw. enthalten.

Ausgabe :

6.

Dieses Element wird verwendet, um dem Benutzer zusätzliche Details über die Webseite anzuzeigen. Dies kann zusätzliche Informationen enthalten, die für den Benutzer optional sind. Dieses Element bietet standardmäßig eine Funktion zum Anzeigen oder Ausblenden von Details beim Klicken.

7.

Dieses Element wird zusammen mit dem Element verwendet. Die Informationen, die ausgeblendet und beim Klicken angezeigt werden sollen, befinden sich in diesem Tag. Dieses Element befindet sich im details-Element.

Code :

Fügen wir in unserem vorhandenen Beispiel Detailelemente zusammen mit dem Zusammenfassungselement hinzu. Fügen Sie einfach den folgenden Code nach den Teilen der Seiten-, Abschnitts- und Artikelelemente im Tag hinzu.


Summary: click here to show details

Details: Wenn Sie auf das Zusammenfassungselement klicken, werden dem Benutzer Details angezeigt


Einzelheiten (
Rand oben: 330px;
Breite: 100%;
Auffüllenoberteil: 10px;
Polsterboden: 50px;
links auffüllen: 15px;
Hintergrundfarbe: # 607d8bdb;
)
Einzelheiten p (
Schriftgröße: 18px;
)
Zusammenfassung (
Farbe weiß;
Schriftgröße: 22px;
)

Output1 : Ohne auf das Detailelement zu klicken.

Output2: Nach Klick auf das Detailelement .

8.

Für jede Webseite gibt es im unteren Teil einen Abschnitt, der als Fußzeile bezeichnet wird. Dieses Element wird verwendet, um den Fußzeilenabschnitt am unteren Rand der Webseite zu definieren. Der Fußzeilenabschnitt enthält im Allgemeinen Informationen wie Urheberrechte, Jahr, Kontaktinformationen usw. Es ist eine übliche Praxis, auf den Webseiten eine Fußzeile zu haben, die sich im unteren Teil einer Webseite befindet.

Code :

Lassen Sie uns auf unserer Webseite im unteren Teil eine Fußzeile hinzufügen.


Footer Section


Footer Section


Footer Section

© Copyright (Jahr)

Ausgabe :

Also unser endgültiger Code und seine Ausgabe wird so aussehen,

Code:



EduCba
li( display: inline-flex;
padding: 25px
)
section(
background-color: #607D8B;
width: 79%;
position: absolute;
height: 150px;
)
article(
width: 79%;
background-color: #607d8bc7;
position: absolute;
top: 368px;
height: 150px;
)
aside(
background-color: #607d8bde;
width: 20%;
position: absolute;
left: 80%;
height: 300px;
)
h2, p (
text-align: center;
color: #fff;
)
ul(
text-align: center;
)
details (
margin-top: 330px;
width: 100%;
padding-top: 10px;
padding-bottom: 50px;
padding-left: 15px;
background-color: #607d8bdb;
)
details p (
font-size: 18px;
)
summary (
color: white;
font-size: 22px;
)


Header Section

Navigation Link1
Navigation Link2
Navigation Link3


Section Part



EduCba
li( display: inline-flex;
padding: 25px
)
section(
background-color: #607D8B;
width: 79%;
position: absolute;
height: 150px;
)
article(
width: 79%;
background-color: #607d8bc7;
position: absolute;
top: 368px;
height: 150px;
)
aside(
background-color: #607d8bde;
width: 20%;
position: absolute;
left: 80%;
height: 300px;
)
h2, p (
text-align: center;
color: #fff;
)
ul(
text-align: center;
)
details (
margin-top: 330px;
width: 100%;
padding-top: 10px;
padding-bottom: 50px;
padding-left: 15px;
background-color: #607d8bdb;
)
details p (
font-size: 18px;
)
summary (
color: white;
font-size: 22px;
)


Header Section

Navigation Link1
Navigation Link2
Navigation Link3


Section Part



EduCba
li( display: inline-flex;
padding: 25px
)
section(
background-color: #607D8B;
width: 79%;
position: absolute;
height: 150px;
)
article(
width: 79%;
background-color: #607d8bc7;
position: absolute;
top: 368px;
height: 150px;
)
aside(
background-color: #607d8bde;
width: 20%;
position: absolute;
left: 80%;
height: 300px;
)
h2, p (
text-align: center;
color: #fff;
)
ul(
text-align: center;
)
details (
margin-top: 330px;
width: 100%;
padding-top: 10px;
padding-bottom: 50px;
padding-left: 15px;
background-color: #607d8bdb;
)
details p (
font-size: 18px;
)
summary (
color: white;
font-size: 22px;
)


Header Section

Navigation Link1
Navigation Link2
Navigation Link3


Section Part


    EduCba
    li( display: inline-flex;
    padding: 25px
    )
    section(
    background-color: #607D8B;
    width: 79%;
    position: absolute;
    height: 150px;
    )
    article(
    width: 79%;
    background-color: #607d8bc7;
    position: absolute;
    top: 368px;
    height: 150px;
    )
    aside(
    background-color: #607d8bde;
    width: 20%;
    position: absolute;
    left: 80%;
    height: 300px;
    )
    h2, p (
    text-align: center;
    color: #fff;
    )
    ul(
    text-align: center;
    )
    details (
    margin-top: 330px;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 50px;
    padding-left: 15px;
    background-color: #607d8bdb;
    )
    details p (
    font-size: 18px;
    )
    summary (
    color: white;
    font-size: 22px;
    )


    Header Section

    Navigation Link1
    Navigation Link2
    Navigation Link3


    Section Part


  • EduCba
    li( display: inline-flex;
    padding: 25px
    )
    section(
    background-color: #607D8B;
    width: 79%;
    position: absolute;
    height: 150px;
    )
    article(
    width: 79%;
    background-color: #607d8bc7;
    position: absolute;
    top: 368px;
    height: 150px;
    )
    aside(
    background-color: #607d8bde;
    width: 20%;
    position: absolute;
    left: 80%;
    height: 300px;
    )
    h2, p (
    text-align: center;
    color: #fff;
    )
    ul(
    text-align: center;
    )
    details (
    margin-top: 330px;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 50px;
    padding-left: 15px;
    background-color: #607d8bdb;
    )
    details p (
    font-size: 18px;
    )
    summary (
    color: white;
    font-size: 22px;
    )


    Header Section

    Navigation Link1
    Navigation Link2
    Navigation Link3


    Section Part


  • EduCba
    li( display: inline-flex;
    padding: 25px
    )
    section(
    background-color: #607D8B;
    width: 79%;
    position: absolute;
    height: 150px;
    )
    article(
    width: 79%;
    background-color: #607d8bc7;
    position: absolute;
    top: 368px;
    height: 150px;
    )
    aside(
    background-color: #607d8bde;
    width: 20%;
    position: absolute;
    left: 80%;
    height: 300px;
    )
    h2, p (
    text-align: center;
    color: #fff;
    )
    ul(
    text-align: center;
    )
    details (
    margin-top: 330px;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 50px;
    padding-left: 15px;
    background-color: #607d8bdb;
    )
    details p (
    font-size: 18px;
    )
    summary (
    color: white;
    font-size: 22px;
    )


    Header Section

    Navigation Link1
    Navigation Link2
    Navigation Link3


    Section Part


  • EduCba
    li( display: inline-flex;
    padding: 25px
    )
    section(
    background-color: #607D8B;
    width: 79%;
    position: absolute;
    height: 150px;
    )
    article(
    width: 79%;
    background-color: #607d8bc7;
    position: absolute;
    top: 368px;
    height: 150px;
    )
    aside(
    background-color: #607d8bde;
    width: 20%;
    position: absolute;
    left: 80%;
    height: 300px;
    )
    h2, p (
    text-align: center;
    color: #fff;
    )
    ul(
    text-align: center;
    )
    details (
    margin-top: 330px;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 50px;
    padding-left: 15px;
    background-color: #607d8bdb;
    )
    details p (
    font-size: 18px;
    )
    summary (
    color: white;
    font-size: 22px;
    )


    Header Section

    Navigation Link1
    Navigation Link2
    Navigation Link3


    Section Part


  • EduCba
    li( display: inline-flex;
    padding: 25px
    )
    section(
    background-color: #607D8B;
    width: 79%;
    position: absolute;
    height: 150px;
    )
    article(
    width: 79%;
    background-color: #607d8bc7;
    position: absolute;
    top: 368px;
    height: 150px;
    )
    aside(
    background-color: #607d8bde;
    width: 20%;
    position: absolute;
    left: 80%;
    height: 300px;
    )
    h2, p (
    text-align: center;
    color: #fff;
    )
    ul(
    text-align: center;
    )
    details (
    margin-top: 330px;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 50px;
    padding-left: 15px;
    background-color: #607d8bdb;
    )
    details p (
    font-size: 18px;
    )
    summary (
    color: white;
    font-size: 22px;
    )


    Header Section

    Navigation Link1
    Navigation Link2
    Navigation Link3


    Section Part


  • EduCba
    li( display: inline-flex;
    padding: 25px
    )
    section(
    background-color: #607D8B;
    width: 79%;
    position: absolute;
    height: 150px;
    )
    article(
    width: 79%;
    background-color: #607d8bc7;
    position: absolute;
    top: 368px;
    height: 150px;
    )
    aside(
    background-color: #607d8bde;
    width: 20%;
    position: absolute;
    left: 80%;
    height: 300px;
    )
    h2, p (
    text-align: center;
    color: #fff;
    )
    ul(
    text-align: center;
    )
    details (
    margin-top: 330px;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 50px;
    padding-left: 15px;
    background-color: #607d8bdb;
    )
    details p (
    font-size: 18px;
    )
    summary (
    color: white;
    font-size: 22px;
    )


    Header Section

    Navigation Link1
    Navigation Link2
    Navigation Link3


    Section Part


  • EduCba
    li( display: inline-flex;
    padding: 25px
    )
    section(
    background-color: #607D8B;
    width: 79%;
    position: absolute;
    height: 150px;
    )
    article(
    width: 79%;
    background-color: #607d8bc7;
    position: absolute;
    top: 368px;
    height: 150px;
    )
    aside(
    background-color: #607d8bde;
    width: 20%;
    position: absolute;
    left: 80%;
    height: 300px;
    )
    h2, p (
    text-align: center;
    color: #fff;
    )
    ul(
    text-align: center;
    )
    details (
    margin-top: 330px;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 50px;
    padding-left: 15px;
    background-color: #607d8bdb;
    )
    details p (
    font-size: 18px;
    )
    summary (
    color: white;
    font-size: 22px;
    )


    Header Section

    Navigation Link1
    Navigation Link2
    Navigation Link3


    Section Part


EduCba
li( display: inline-flex;
padding: 25px
)
section(
background-color: #607D8B;
width: 79%;
position: absolute;
height: 150px;
)
article(
width: 79%;
background-color: #607d8bc7;
position: absolute;
top: 368px;
height: 150px;
)
aside(
background-color: #607d8bde;
width: 20%;
position: absolute;
left: 80%;
height: 300px;
)
h2, p (
text-align: center;
color: #fff;
)
ul(
text-align: center;
)
details (
margin-top: 330px;
width: 100%;
padding-top: 10px;
padding-bottom: 50px;
padding-left: 15px;
background-color: #607d8bdb;
)
details p (
font-size: 18px;
)
summary (
color: white;
font-size: 22px;
)


Header Section

Navigation Link1
Navigation Link2
Navigation Link3


Section Part



EduCba
li( display: inline-flex;
padding: 25px
)
section(
background-color: #607D8B;
width: 79%;
position: absolute;
height: 150px;
)
article(
width: 79%;
background-color: #607d8bc7;
position: absolute;
top: 368px;
height: 150px;
)
aside(
background-color: #607d8bde;
width: 20%;
position: absolute;
left: 80%;
height: 300px;
)
h2, p (
text-align: center;
color: #fff;
)
ul(
text-align: center;
)
details (
margin-top: 330px;
width: 100%;
padding-top: 10px;
padding-bottom: 50px;
padding-left: 15px;
background-color: #607d8bdb;
)
details p (
font-size: 18px;
)
summary (
color: white;
font-size: 22px;
)


Header Section

Navigation Link1
Navigation Link2
Navigation Link3


Section Part



EduCba
li( display: inline-flex;
padding: 25px
)
section(
background-color: #607D8B;
width: 79%;
position: absolute;
height: 150px;
)
article(
width: 79%;
background-color: #607d8bc7;
position: absolute;
top: 368px;
height: 150px;
)
aside(
background-color: #607d8bde;
width: 20%;
position: absolute;
left: 80%;
height: 300px;
)
h2, p (
text-align: center;
color: #fff;
)
ul(
text-align: center;
)
details (
margin-top: 330px;
width: 100%;
padding-top: 10px;
padding-bottom: 50px;
padding-left: 15px;
background-color: #607d8bdb;
)
details p (
font-size: 18px;
)
summary (
color: white;
font-size: 22px;
)


Header Section

Navigation Link1
Navigation Link2
Navigation Link3


Section Part

Etwas Text



Artikel Teil


Etwas ausführlicher Text


Teil der Seitenleiste


Dies wird statischen Teil oder irgendetwas wie Werbung usw. enthalten.


Zusammenfassung: Klicken Sie hier, um Details anzuzeigen

Details: Wenn Sie auf das Zusammenfassungselement klicken, werden dem Benutzer Details angezeigt


Fußzeile


© Copyright (Jahr)

Ausgabe :

Fazit

Daher sind HTML-Layoutelemente beim Entwerfen der Webseite sehr nützlich. Sie helfen Entwicklern, gut strukturierte Webseiten zu entwerfen. Die ordnungsgemäße Verwendung von HTML-Layoutelementen verbessert das Leseerlebnis von Webseiten. Wir haben vor allem die wichtigsten HTML-Layout-Elemente im Detail gesehen.

Empfohlene Artikel

Dies ist eine Anleitung zum HTML-Layout. Hier diskutieren wir HTML Layout Element mit dem Beispiel, Codes und Ausgaben im Detail. Sie können auch unsere anderen verwandten Artikel durchgehen, um mehr zu erfahren -

  1. Erstellen Sie Tabellen in HTML
  2. HTML-Schriftarten
  3. HTML-Bild-Tags
  4. HTML-Frames
  5. HTML-Blöcke
  6. Stellen Sie eine Hintergrundfarbe in HTML mit Beispiel ein