HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

dialog

Description

The dialog element for HTML represents a part of an application that a user interacts with to perform a task.

Syntax

HTML

<dialog attribute-name="attribute-value"></dialog>

Attributes

Global

NameValueDescription
openopen | emptyelement is active and the user can interact with it

CSS

dialog
{
    background: white;
    border: solid;
    color: black;
    height: fit-content;
    left: 0;
    margin: auto;
    padding: 1em;
    position: absolute;
    right: 0;
    width: fit-content;
}
dialog:not([open])
{
    display: none;
}
dialog::backdrop
{
    background: rgb(0 0 0 / 0.1);
}

Examples

1 · closed

2 · open

3 · CSS

4 · JS · show

5 · JS · showModal

6 · JS · show showModal