JSFiddle - React, Tailwind, and code Playground

by Vadim

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Document</title>
</head>
<body>
    <div class="popup popup_with-image">
        <div class="popup__container">
            <button type="button" class="popup__close-button"></button>
            <img src="https://i.pinimg.com/736x/04/86/55/04865525aafc5cefcfe8277c93bdd381--paris-eiffel-towers-photography-backdrops.jpg" alt="фото превью" class="popup__big-picture">
        </div>
    </div>
</body>
</html>

CSS

.popup {
    display: flex;
    position: fixed;
    
    justify-content: center;
    align-items: center;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: RGBa(51, 51, 51, 0.9);
}

.popup__container {
    align-items: center;
    justify-content: center;
    display: flex;
    flex-direction: row-reverse;
    max-width: 1200px;
    height: 100vh;
}

.popup__close-button {
    display: inline;
    background: url(exit-icon.png) no-repeat;
    background-size: 28px;
    width: 32px;
    height: 32px;
    outline: none;
    border: none;
    cursor: pointer;
    position: relative;
    align-self: flex-start;
    top: -28px;
}

.popup__big-picture {
    display: block;
    width: calc(98% - 32px);
    object-fit: contain;
    object-position: center center;
    height: 100%;
}