Seeking guidance in my journey to learn HTML and CSS, I am attempting to create a dialog box that can be closed with the click of an X button.
Despite successfully adding the X button to the dialog box's upper bar, I am facing an issue where clicking the button does not close the dialog. It remains persistent on the screen after each click.
I am puzzled by this problem and would appreciate any suggestions or solutions to tackle it effectively.
.close {
color: white;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover {
opacity: 1;
}
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
<div class="modal-header" data-closable="slide-out-up">
<button class="close" aria-label="Dismiss alert" type="button" data-close>
<span aria-hidden="true"><i class="fa fa-window-close">X</i></span>
</button>
</div>