Practical Experiment: What Happens When You Try To Clone Amazon’s Layout?

Oscar Bastos
4 min readSep 1, 2021

Pixel-Perfect Amazon’s layout

Amazon’s pixel-perfect layout clone

As a web developer, have you ever wondered how much time and effort it takes to create a perfect clone of a world-famous website? At coding bootcamps, it’s a common exercise for students to practice their skills by replicating a website in just a few days. But what about for experienced developers? Through this challenge, we dive into the questions of how difficult it is to replicate a website, what can be learned from analyzing the HTML/CSS code of a real website, and how much time it takes to achieve pixel-perfect results.

Is it possible to take this cloning exercise to the next level? create a pixel perfect clone? create something better than the original?

Personal Experiment. I set out to create my own replica of a website, but instead of cloning the entire site, I wanted to focus solely on the layout. While it’s possible to add more elements and functionality to make the clone almost identical to the original, I believe that by just developing the layout, we can gain valuable insights.

Where do we start?

Amazon’s real website

To create an appealing layout on Amazon, we begin by analyzing their CSS and HTML code using Google developer tools. This allows us to understand how they use CSS flexbox to position and wrap their cards. Additionally, the code re-orders the cards to maintain the video card in a consistent position while allowing for the wrapping of the other cards.

Let’s Create the Amazon’s Layout Clone

  1. Position the header and navigation bars for optimal user experience.
  2. Include a hero banner container to showcase key information or imagery.
  3. Utilize a card container and place it above the hero banner for visual hierarchy.
  4. Implement cards, including a prominent “big card” in black, to present content in a clear and organized manner.
  5. Utilize media queries to dynamically adjust the position of the big card while ensuring that the other cards wrap responsively. Additionally, pass in the order number as a prop to ensure accurate display.
Video card stays in same position while other cards wrap
Cloned responsiveness

It took me around 1.5 hours to analyze Amazon’s CSS and HTML, create the project from scratch, and clone the layout, including its real responsiveness.

Cloning this layout wasn’t too difficult, as long as you have a good understanding of how to dissect a website using developer tools, knowledge of flexbox, and experience with CSS.

The most challenging aspect was handling the reordering of cards on window resizing and keeping the video card in the same position while other cards wrapped.

Analyzing the HTML/CSS code of a real website like Amazon is a valuable learning experience. It allows you to understand how the layout was created, identify areas for improvement, and learn new development techniques.

Raising the Bar

I wanted to increase the difficulty of this cloning exercise, as I have more experience than a student who is just learning web development:

  • Created a pixel-perfect clone (not just a layout that looks similar),
  • Reduced the number of DIVs (Amazon’s HTML can be a bit cluttered with them)
  • Minimized the CSS code (using only 90 lines). I also ensured the clone was fully responsive.

Is it possible to improve upon the original?

Absolutely!

The beauty of innovation is the constant strive for excellence, and the potential to surpass even the most established industry leaders. By utilizing the latest technologies and design principles, it is entirely possible to create web applications that are not only more efficient and performant, but also visually stunning.

--

--