I use Javascript, css Grid for this...
the runnable Jfiddle is in the end of the explation.

JavaScript Explanation
for this, I used JavaScript for creating pixel elements using a for loop
so now all the JavaScript generated elements will have the same style (CSS)
the generated element is now is child of the parent .pixel-container because of using .innerHTML
the trick here is using += that get the already written html and put your code (.pixel div child)
...
this code is inside a function named createPixel(); ,
every time you will write it, it will create a pixel! so i looped it (code below)
let pixelContainer = document.querySelectorAll('.pixel-container');
let numPixel = 100 - 1; // is because one pixel is already created
function createPixel() {
/* create a pixel in your top left corner */
pixelContainer[0].innerHTML += '<div class="pixel"></div>';
/* create a pixel in your top right corner */
pixelContainer[1].innerHTML += '<div class="pixel"></div>';
}
/* lopping the createPixel() */
for (let index = 0; index < numPixel; index++) {
createPixel();
}
css Explanation
I used grid for creating a repeated 10 times horizontally the .pixel div
grid-template-columns: repeat(10, auto);
and some gap gap: 0.5em; in the parent element so all child now have something similar to margins :)
the idea
the idea is creating a parent div with position: relative
and with the parent of pixel child put position: absolute
now position them with top, bottom, left, right (code below)
* {
/* css variable, easy to change (one time for all) */
--outside-value: -2em;
}
#content {
position: relative;
}
.pixel-container.pixel-bottom {
position: absolute;
top: var(--outside-value);
left: var(--outside-value);
}
.pixel-container.pixel-top {
position: absolute;
bottom: var(--outside-value);
right: var(--outside-value);
}
html Explanation
I created a parent element #content, so <body> won't be the parent (now you can work quiet on your html, without affecting the image and the pixels)
<body>
<div id="content">
...
</div>
</body>
the .pixel divs are inside their parent
<div class="pixel-container">
<div class="pixel"></div>
</div>
there is 2 parent (.pixel-container) that have inside the pixel div childs,
the first I assegned the class pixel-top and the second pixel-bottom
<div id="content">
<div class="pixel-container pixel-top">
<div class="pixel"></div>
</div>
<img src="https://laaouatni.github.io/w11-clone/images/1dark.jpg" alt="festa picina">
<div class="pixel-container pixel-bottom">
<div class="pixel"></div>
</div>
</div>
runnable Jffidle
let pixelContainer = document.querySelectorAll('.pixel-container');
let numPixel = 100 - 1; // is because one pixel is already created
function createPixel() {
/* create a pixel in your top left corner */
pixelContainer[0].innerHTML += '<div class="pixel"></div>';
/* create a pixel in your top right corner */
pixelContainer[1].innerHTML += '<div class="pixel"></div>';
}
/* lopping the createPixel() */
for (let index = 0; index < numPixel; index++) {
createPixel();
}
/* easy to change a value
one time of all your css
*/
* {
--gold-color: #C7B273;
--pixel-size: 0.2em;
--outside-value: -2em;
}
html,
body {
height: 100%;
}
/* centering */
body,
#content {
display: flex;
justify-content: center;
align-items: center;
}
/* pixel css */
.pixel {
height: var(--pixel-size);
width: var(--pixel-size);
background-color: var(--gold-color);
border-radius: 50%;
}
img {
width: 400px;
z-index: 2;
}
/* repeating */
.pixel-container {
display: grid;
grid-template-columns: repeat(10, auto);
gap: 0.5em;
}
/* positioning */
#content {
position: relative;
}
.pixel-container.pixel-bottom {
position: absolute;
top: var(--outside-value);
left: var(--outside-value);
}
.pixel-container.pixel-top {
position: absolute;
bottom: var(--outside-value);
right: var(--outside-value);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
<script src="script.js" defer></script>
</head>
<body>
<div id="content">
<div class="pixel-container pixel-top">
<div class="pixel"></div>
</div>
<img src="https://laaouatni.github.io/w11-clone/images/1dark.jpg" alt="festa picina">
<div class="pixel-container pixel-bottom">
<div class="pixel"></div>
</div>
</div>
</body>
</html>