HTML Explanation
01
The HTML structure begins with a clickable link <a> that opens the modal.
02
The id attribute in the modal-closed anchor tag is used to control the modal state via CSS when it is targeted.
03
The modal content is housed in a div with the modal-container class and an id of modal-opened.
04
This id allows the modal to be targeted when the link is clicked.
05
Inside the modal-container, the modal class wraps all the modal content.
CSS Explanation
01
Basic styling is applied to all elements to reset margins, paddings, and box-sizing.
02
The body uses flexbox for centering content, a specific font family, and a gradient background.
03
The .modal-container is initially hidden with display: none; and positioned fixed to cover the entire viewport.
04
The modal is revealed using the :target pseudo-class, which displays the modal when the corresponding anchor (#modal-opened) is targeted.
05
.modal__details centers the title and description, with a bottom border for separation.
06
.modal__title is styled with a large font size.
07
.modal__description has italic text.
08
.modal__text has padding for comfortable reading and a consistent line height.
09
A decorative circle (::before) is added to the .modal__text using absolute positioning and borders.
10
The .modal__btn is a button with a border and rounded corners.
11
It has a hover and focus effect where the border color darkens slightly, and the button moves up a bit (transform: translateY(-.2rem);).
Javascript Explanation
01
No Javascript code needed