HTML <hr> tag
Definitie en gebruik
<hr>
Tags definiëren thematische scheidingen in HTML-pagina's (bijvoorbeeld, verandering van onderwerp).
<hr>
Elementen worden meestal weergegeven als horizontale lijnen, gebruikt om inhoud op een HTML-pagina te scheiden of veranderingen in de inhoud te definiëren.
Zie ook:
HTML DOM-handboek:HR-object
Voorbeeld
Voorbeeld 1
Gebruik <hr>
Tags om thematische veranderingen in de inhoud te definiëren:
<h1>Hoofdtaal van het web</h1> <p>HTML is de standaard markertaal voor het maken van webpagina's. HTML beschrijft de structuur van webpagina's, die bestaan uit een reeks elementen...</p> <hr> <p>CSS is een taal om het weergavegedrag van HTML-elementen op het scherm, papier of andere media te beschrijven...</p> <hr> <p>JavaScript is de programmeertaal van HTML en het web. JavaScript kan HTML-inhoud en eigenschappen wijzigen...</p>
Voorbeeld 2
Alineatie <hr>
Element (Gebruik CSS):
<hr style="width:50%;text-align:left;margin-left:0">
Voorbeeld 3
Zonder schaduw <hr>
(Gebruik CSS):
<hr style="height:2px;border-width:0;color:gray;background-color:gray">
Example 4
Set <hr>
Element height (using CSS):
<hr style="height:30px">
Example 5
Set <hr>
Element width (using CSS):
<hr style="width:50%">
Global attributes
<hr>
The tag also supports Global attributes in HTML.
event attributes
<hr>
The tag also supports Event attributes in HTML.
Default CSS settings
Most browsers will display the following default values <hr>
Element:
hr { display: block; margin-top: 0.5em; margin-bottom: 0.5em; margin-left: auto; margin-right: auto; border-style: inset; border-width: 1px; }
Browser support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |