<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kehinde_Daniels</title>
    <description>The latest articles on DEV Community by Kehinde_Daniels (@kehindedaniels).</description>
    <link>https://dev.to/kehindedaniels</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1138967%2F71b78b4e-350c-4cbe-9b0d-c4fc372500ed.jpg</url>
      <title>DEV Community: Kehinde_Daniels</title>
      <link>https://dev.to/kehindedaniels</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kehindedaniels"/>
    <language>en</language>
    <item>
      <title>WhatsApp for Developers</title>
      <dc:creator>Kehinde_Daniels</dc:creator>
      <pubDate>Sun, 26 May 2024 14:54:28 +0000</pubDate>
      <link>https://dev.to/kehindedaniels/whatsapp-for-developers-28dg</link>
      <guid>https://dev.to/kehindedaniels/whatsapp-for-developers-28dg</guid>
      <description>&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1777799502453215731-959" src="https://platform.twitter.com/embed/Tweet.html?id=1777799502453215731"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1777799502453215731-959');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1777799502453215731&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;Someone saw me writing code (JavaScript) and literally asked me, do I speak 1s and 0s too. I couldn’t help but laugh😂 (don’t worry, she was a friend, so no offense was taken, and I helped her understand better too☺️). That’s what we were taught in primary school — that the computer’s language is 0s and 1s, right? So, to be a computer programmer, you should know how to ‘speak’ binary code… I bet that’s what you’re thinking too😂.&lt;/p&gt;

&lt;p&gt;But unless you have a CS (computer science) degree, which I don’t (I’m self-taught), no YouTube video will teach you JavaScript starting with zeros and ones. In fact, no programmer communicates with the computer in 0s and 1s directly; that’s the job of compilers and interpreters, which convert what we write into machine language. But let me not bore you with all that computer jargon, because I don’t fully understand how that magic works either.&lt;/p&gt;

&lt;p&gt;Well, write code in high-level languages, which are easier for humans to understand and use. But hey, it’s not just plain English, least you think you can just start coding and get a job…&lt;/p&gt;

&lt;p&gt;Try it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello, World!&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I bet this looks like an alien language to you, except if you’re a developer. This is an example of a high-level language that will be compiled into binary code for the computer to understand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I’m Writing This Case Study
&lt;/h2&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1777909396724736275-66" src="https://platform.twitter.com/embed/Tweet.html?id=1777909396724736275"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1777909396724736275-66');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1777909396724736275&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;This meme got me on my knees😂. But that's the truth, yeah? Even Mozart’s pet can feel our pain.&lt;/p&gt;

&lt;p&gt;WhatsApp is a platform for communities, and one prevalent community is the tech world. I belong to a few myself&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foaf4vb3nbx3ldpume5l9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foaf4vb3nbx3ldpume5l9.png" alt="A WhatsApp group home page" width="250" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I can say for sure that many have received help and rendered help by reviewing and correcting other people’s code snippets. But helping or asking for help can often be very stressful. No one talks about the developer experience… so sad, yeah.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Often, you have to make a screenshot or copy and paste code snippets, which is a hassle because the code will be almost ‘unreadable’&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftott5zv9veihihxfz46r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftott5zv9veihihxfz46r.png" alt="The image shows a comparison between a code snippet displayed on WhatsApp versus a code snippet displayed on a text editor. On the left side, the code snippet is shown in WhatsApp, lacking syntax highlighting and formatting. On the right side, the same code snippet is shown in a text editor with proper syntax highlighting and formatting, making it easier to read and understand. The difference highlights the advantage of using a text editor for viewing and editing code." width="800" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, whether you’re a dev or not, don’t try to understand the code. I just want you to compare both visuals and judge which is more appealing and looks more comprehensible. The second image, right? It’s not easy to understand a programming language; it’s harder to grasp without its proper syntax format (like the reds and blues you see in the image).&lt;/p&gt;

&lt;h2&gt;
  
  
  What If?
&lt;/h2&gt;

&lt;p&gt;What if WhatsApp supported markdown features with syntax formatting? That would make the lives of developers less stressful. I know they've got this using a backtick &lt;code&gt;around a word&lt;/code&gt; that gives it a mono-spacing styling, but I'm talking about a bit more sophisticated markdown with syntax formatting.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Would It Work?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Auto-detect:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F88fbivvobqjgci14i9dl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F88fbivvobqjgci14i9dl.png" alt="A smartphone screen displaying a WhatsApp chat conversation with a user named Toyan He/Him. The chat background is dark-themed with green text bubbles. The conversation includes a message asking, “How can I center a div?” The response is “Check this” with a dropdown menu visible showing code options such as Auto detect, HTML, JavaScript, Bash, C#, CSS, and Go. The WhatsApp logo is visible in the top left corner of the image." width="800" height="809"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once it brings out the dialogue code block, it can auto-detect as you start typing. Or you could specify the language you want to write in.&lt;/p&gt;

&lt;h2&gt;
  
  
  No Need to Reinvent the Wheel
&lt;/h2&gt;

&lt;p&gt;They’ve got an attachment menu that allows users to send various types of files in chats. They could extend this functionality by adding an ‘Embed Code Block’ option to the menu.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnwatjgcqus13j45564p0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnwatjgcqus13j45564p0.png" alt="Two side-by-side screenshots of a smartphone screen displaying a WhatsApp chat. The left screenshot shows the attachment options without a code block feature, including Document, Camera, Gallery, Audio, Payment, Location, Contact, and Poll. The right screenshot shows the same attachment options with an additional “Code Block” feature highlighted in purple. The WhatsApp logo is visible in the top left corner of the image" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Addressing Edge Cases
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;What if I’m not a developer?
I recognize not not everyone is a developer, and might have no use for it at all. Well, for non-developers, the platform continues to offer secure and efficient communication. The introduction of developer-specific features does not detract from its usability for everyday conversations. Instead, it expands the versatility of WhatsApp, making it a more comprehensive tool for various types of interactions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But some users might find it unnecessary, So, I made a developer option in the settings, Users can toggle the dev option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F790vwsoho31xec4sxsx1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F790vwsoho31xec4sxsx1.gif" alt="A GIF showing two sections of a WhatsApp interface. The left section displays WhatsApp chat settings, with options like “Enter is send,” “Media visibility,” “Developer Option,” and others. The “Developer Option” is toggled on. The right section shows the attachment options menu with Document, Camera, Gallery, Audio, Payment, Location, Contact, Poll, and the newly added “Code Block” feature highlighted in purple. The background features a grid pattern" width="739" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Limited Screen Space&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Of course, it is not expected that you build an entire website on WhatsApp, the goal is not to replace our regular code editor, rather it’s to help communication flow better. Good enough we have WhatsApp desktop, so while you’re working in your code editor and you encounter a problem, you can just quickly copy a code snippet to the clipboard and paste it into the Whatsapp code block. Plus I Implemented a scrollable code block and a pinch-to-zoom feature for better readability.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9yeuxpm787lbjn4xr64w.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9yeuxpm787lbjn4xr64w.gif" alt="WhatsApp’s desktop application displayed on a laptop screen. The chat shows a conversation between two users discussing a JavaScript code snippet. The code snippet is shown with syntax highlighting within the WhatsApp chat window." width="739" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Typing on mobile devices can be cumbersome:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It's integrated with desktop or web versions plus enhanced support for code editing, like syntax highlighting, and very importantly, autocomplete.&lt;/p&gt;

&lt;p&gt;So, in Conclusion&lt;br&gt;
Just imagine it’s one line of code causing an error for a junior dev; you don’t want to open your editor and start typing all over. You could copy, paste, and edit right there without leaving WhatsApp. This is the goal!&lt;/p&gt;

&lt;p&gt;I dropped a design case study on Behance for this, kindly check &lt;a href="https://www.behance.net/gallery/198336617/WhatsApp-for-Devs"&gt;here &lt;/a&gt;, to see visuals.&lt;/p&gt;

&lt;p&gt;But I’m curious anyway&lt;/p&gt;

&lt;p&gt;If WhatsApp were to implement these features, would developers really use it? Are there any other edge cases to consider before giving it a go? Let me know!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>computerscience</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
    <item>
      <title>FEM-1 Product Preview Card Component</title>
      <dc:creator>Kehinde_Daniels</dc:creator>
      <pubDate>Thu, 28 Dec 2023 01:40:25 +0000</pubDate>
      <link>https://dev.to/kehindedaniels/fem-1-product-preview-card-component-4b33</link>
      <guid>https://dev.to/kehindedaniels/fem-1-product-preview-card-component-4b33</guid>
      <description>&lt;h2&gt;
  
  
  1.0 Overview
&lt;/h2&gt;

&lt;p&gt;Ever felt overwhelmed starting a challenge? Don't worry; we've got you covered. This guide focuses on frontend mentor challenges, aiming to explain our decisions while building from scratch.&lt;/p&gt;

&lt;p&gt;Oh, sorry, I lied. Before we begin, if you would like to jump directly to the final code and be lazy like me, click &lt;a href="https://github.com/KehindeDaniels/FEM-1-product-preview-card-component-main.git"&gt;here&lt;/a&gt;, but don't be lazy to give me a star yeah?😉&lt;/p&gt;

&lt;h2&gt;
  
  
  2.0 Writing the html
&lt;/h2&gt;

&lt;p&gt;Mobile-first or Desktop-first: Where to Start?. &lt;br&gt;
Well, if you chose mobile-first design, you're not alone! 😄 However, despite its popularity for CSS styling, starting with the desktop-design view when constructing your web's skeleton (HTML) can be a game-changer.&lt;/p&gt;

&lt;p&gt;Here's why: Mobile designs often follow a top-to-bottom layout, making it tricky to determine element groupings for the web layout.&lt;/p&gt;

&lt;p&gt;So, &lt;/p&gt;

&lt;p&gt;CSS: Mobile-first design approach,&lt;/p&gt;

&lt;p&gt;HTML: Desktop-design approach&lt;/p&gt;

&lt;p&gt;So, let's begin!&lt;/p&gt;

&lt;p&gt;First, I want to believe you have your environment set and have downloaded the starter file. If not, no worries, you can download it from &lt;a href="https://github.com/KehindeDaniels/product-preview-card-component-main.git"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.1 Basic Layout&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;article&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"product__card"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This simplified structure is designed specifically for styling the product card. It utilizes the &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt; HTML element, which is ideal for presenting content as an individual and self-contained unit.&lt;/p&gt;

&lt;p&gt;Now, before we start writing codes like hackers, its important we first analyze the design so we can know how to structure it well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YsS00MzF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ui29novey0t40w1km8r9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YsS00MzF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ui29novey0t40w1km8r9.png" alt="Gabrielle Essence Eau De Parfum Bottle" width="779" height="553"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the above image, we know we have to divide our products into two columns, which in our markup will be represented by two divisions.&lt;/p&gt;

&lt;p&gt;The first division will have the images (mobile and desktop-sized), and the second division will have the card content or details.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.2 Product Image Markup (The product element)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt; &lt;span class="c"&gt;&amp;lt;!-- html  --&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;article&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"product"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
       &lt;span class="c"&gt;&amp;lt;!-- Product Image --&amp;gt;&lt;/span&gt;
       &lt;span class="nt"&gt;&amp;lt;picture&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;source&lt;/span&gt; &lt;span class="na"&gt;srcset=&lt;/span&gt;&lt;span class="s"&gt;"images/image-product-desktop.jpg"&lt;/span&gt; &lt;span class="na"&gt;media=&lt;/span&gt;&lt;span class="s"&gt;"(min-width:600px)"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"./images/image-product-mobile.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Gabrielle Essence Eau De Parfum Bottle"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/picture&amp;gt;&lt;/span&gt;

      &lt;span class="c"&gt;&amp;lt;!-- Product Content  --&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"product__content"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

      &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hi there, don't be blown away by the &lt;code&gt;&amp;lt;picture&amp;gt;&lt;/code&gt; element we used. We learn everyday right. But let's talk about it briefly&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.2.1 The &lt;code&gt;&amp;lt;picture&amp;gt;&lt;/code&gt; element&lt;/strong&gt;&lt;br&gt;
The &lt;code&gt;&amp;lt;picture&amp;gt;&lt;/code&gt; element in HTML is used to provide different versions of an image based on factors like screen size or resolution. &lt;/p&gt;

&lt;p&gt;I feel this is better than wrapping two &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; elements in a div and then styling them separately to either display or hide based on the screen size. &lt;/p&gt;

&lt;p&gt;Here, the &lt;code&gt;&amp;lt;source&amp;gt;&lt;/code&gt; element is used to specify different versions of the image based on certain conditions using the &lt;code&gt;srcset&lt;/code&gt; attribute.&lt;/p&gt;

&lt;p&gt;Inside each &lt;code&gt;&amp;lt;source&amp;gt;&lt;/code&gt; element, you define the image source (srcset) and use the media attribute to set conditions (like screen width using media queries) for when that particular image should be displayed.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; will serve as a fallback or default image source that will be displayed if none of the  elements match the conditions or if the browser doesn’t support the  element. It's also used for accessibility purposes by providing the alt attribute to describe the image.&lt;/p&gt;

&lt;p&gt;If you are still not clear, you can take a few seconds to look it up in &lt;a href="https://www.w3schools.com/html/html_images_picture.asp"&gt;w3schools here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, lets fill up the mark-up for the product content, so we can move straight to CSS. I know that's where you heading for right?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.3 Product Content Mark-up&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt; &lt;span class="c"&gt;&amp;lt;!-- html  --&amp;gt;&lt;/span&gt;
      &lt;span class="c"&gt;&amp;lt;!-- Product Content  --&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"product__content"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

        &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"product__category"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Perfume&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

        &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"product__title"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Gabrielle Essence Eau De Parfum&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

        &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"product__description"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;A floral, solar and voluptuous interpretation composed by Olivier Polge, 
        Perfumer-Creator for the House of CHANEL.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;


          &lt;span class="c"&gt;&amp;lt;!-- Product Price --&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"product__price"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;$149.99&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&amp;lt;s&amp;gt;&lt;/span&gt;$169.99&lt;span class="nt"&gt;&amp;lt;/s&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;


        &lt;span class="c"&gt;&amp;lt;!-- Button --&amp;gt;&lt;/span&gt;

        &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;aria-label=&lt;/span&gt;&lt;span class="s"&gt;"Add Gabrielle Essence Eau De Parfum to Cart"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"images/icon-cart.svg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
          Add to Cart
        &lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;  

       &lt;span class="c"&gt;&amp;lt;!-- &amp;lt;button aria-label="Add Gabrielle Essence Eau De Parfum to Cart" data-icon="shopping-cart"&amp;gt;Add to Cart&amp;lt;/button&amp;gt;  --&amp;gt;&lt;/span&gt;

      &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You would notice the commented-out button used, but fear not! I will explain that towards the end so spend too much ti&lt;br&gt;
me drawing our skelenton.&lt;/p&gt;

&lt;p&gt;A few things to note from the above mark-up&lt;/p&gt;
&lt;h2&gt;
  
  
  3.0 Writing the CSS
&lt;/h2&gt;

&lt;p&gt;Now, the interesting part!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.1 CSS Reset&lt;/strong&gt;&lt;br&gt;
The first thing you want to do is have a reset. Trust me, you don't want to work without a reset, as some elements have default margin and spacing, which you may not want in your style.&lt;/p&gt;

&lt;p&gt;CSS reset styles are used to standardize and neutralize default styles applied by different browsers to HTML elements. It ensures a consistent starting point for styling, helping you avoid inconsistencies and achieve more control over the appearance of elements across various browsers&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt; &lt;span class="c"&gt;/* CSS */&lt;/span&gt;
&lt;span class="c"&gt;/* Box sizing rules */&lt;/span&gt;
&lt;span class="o"&gt;*,&lt;/span&gt;
&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;::before&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;::after&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;box-sizing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;border-box&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Remove default margin */&lt;/span&gt;
&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;h3&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;h4&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;figure&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;blockquote&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;dl&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;dd&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;margin-block-end&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */&lt;/span&gt;
&lt;span class="nt"&gt;ul&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;'list'&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt;
&lt;span class="nt"&gt;ol&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;'list'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;list-style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Set core root defaults */&lt;/span&gt;
&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="nd"&gt;:focus-within&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;scroll-behavior&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;smooth&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Set core body defaults */&lt;/span&gt;
&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;min-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-rendering&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;optimizeSpeed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;line-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* A elements that don't have a class get default styles */&lt;/span&gt;
&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:not&lt;/span&gt;&lt;span class="o"&gt;([&lt;/span&gt;&lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;text-decoration-skip-ink&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Make images easier to work with */&lt;/span&gt;
&lt;span class="nt"&gt;img&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;picture&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Inherit fonts for inputs and buttons */&lt;/span&gt;
&lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;textarea&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;select&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;inherit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */&lt;/span&gt;
&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prefers-reduced-motion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;html&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;focus-within&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
   &lt;span class="n"&gt;scroll-behavior&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="o"&gt;*,&lt;/span&gt;
  &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;::before&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;::after&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;animation-duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.01ms&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;animation-iteration-count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;transition-duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.01ms&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;scroll-behavior&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This whole reset code is provided by Andy bell, you can check &lt;a href="https://andy-bell.co.uk/a-modern-css-reset/"&gt;here&lt;/a&gt; for the full documentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.2 Re-usable Variables&lt;/strong&gt;&lt;br&gt;
The DRY (D-on't R-epeat yourself) principle is not just applied in JavaScript, I mean, even in life generally, who wants to do the same rigorous process when there is a better way to go about it? CSS is not an exemption. You don't want to 'hard-condignly' change a color through out your CSS file when you could simply change it once. &lt;/p&gt;

&lt;p&gt;Now, this is a small project, but we will still implement variables for best styling practice&lt;/p&gt;

&lt;p&gt;&lt;em&gt;CSS variables are applied to the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:root"&gt;&lt;code&gt;:root&lt;/code&gt;&lt;/a&gt; &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes"&gt;pseudo-class&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;:root&lt;/code&gt; in CSS refers to the highest-level parent element, usually the &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; element. It's commonly used to declare global CSS variables (custom properties) accessible throughout the document, ensuring consistent values and easy modifications across stylesheets.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt; &lt;span class="c"&gt;/* CSS */&lt;/span&gt;
&lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="py"&gt;--clr-primary-cyan&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;158&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;36%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;40%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="py"&gt;--clr-primary-cyan-dark&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;158&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;36%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;30%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="py"&gt;--clr-primary-cream&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;38%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;92%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="py"&gt;--clr-neutral-dark-blue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;212&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;21%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;14%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="py"&gt;--clr-neutral-grayish-blue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;228&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;12%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;48%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="py"&gt;--clr-white&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="py"&gt;--ff-body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;'Montserrat'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--ff-secondary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;'Fraunces'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="py"&gt;--fw-regular&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;500&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--fw-bold&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;700&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What we have done basically is define the colors &lt;code&gt;--clr&lt;/code&gt;, font family &lt;code&gt;--ff&lt;/code&gt; and font weight &lt;code&gt;--fw&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It is important to note that for larger projects, the variables might be more than this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.2 Little adjustment to the body&lt;/strong&gt;&lt;br&gt;
We already have some reset code to the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; element, but for the purpose of this small project we will add a few more&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Center the card on our page (grid/flex)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;and a default font-size: 0.875rem;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt; &lt;span class="c"&gt;/* CSS */&lt;/span&gt;

&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;place-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You could as well display flex, justify, and align items to center; well, that's an extra line of code. Who likes extra?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.3 Styling the product container&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B6NghauZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mj18q7rca9egbyz5qfzt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B6NghauZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mj18q7rca9egbyz5qfzt.png" alt="Gabrielle Essence Eau De Parfum Bottle" width="800" height="1423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nothing much here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;give it a background color&lt;/li&gt;
&lt;li&gt;make the border radius little rounded and&lt;/li&gt;
&lt;li&gt;to prevent the elements from overflowing outside because of the shortened rounded border radius, we set to hidden. (try commenting out the overflow property and observe the difference)
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt; &lt;span class="c"&gt;/* CSS */&lt;/span&gt;
&lt;span class="nc"&gt;.product&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--clr-white&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;.5rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;overflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;em&gt;var(--custom-css-property); is how we use our variables in case you are wondering what that means&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.4 Styling the product image&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thanks to our reset, we already have enough to make our images and pictures responsive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt; &lt;span class="c"&gt;/* CSS */&lt;/span&gt;

 &lt;span class="c"&gt;/* This is already declared in the reset, no need re-declaring */&lt;/span&gt;
&lt;span class="nt"&gt;img&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;picture&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3.5 Styling the product content&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AOKidc3w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jix29y0m20f0171o1h0r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AOKidc3w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jix29y0m20f0171o1h0r.png" alt="Image description" width="800" height="780"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Where we are going: Notice the space around (padding) the content; hence we need to set padding. &lt;/p&gt;

&lt;p&gt;Where we are: Notice the button does not take up the entire width of the container because they are &lt;code&gt;in-line&lt;/code&gt; elements. We can solve this in various ways by setting its &lt;code&gt;width&lt;/code&gt; to 100%, but in this scenario, we will utilize the grid method. when you set a container to grid, its children's elements take up the entire width of the container.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt; &lt;span class="c"&gt;/* CSS */&lt;/span&gt;

&lt;span class="nc"&gt;.product__content&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.5rem&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;.5rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the difference now if you are following along.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6ntkLVmD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qgk2nw4mtadv0yx49mlp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6ntkLVmD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qgk2nw4mtadv0yx49mlp.jpg" alt="Image description" width="534" height="1005"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.5.1 Styling the Product Category&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is as straight-forward as:&lt;/p&gt;

&lt;p&gt;we set the font-family, give it spacing as seen in the final design, and set the text to uppercase&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* CSS */&lt;/span&gt;
&lt;span class="nc"&gt;.product__category&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--ff-secondary&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nl"&gt;letter-spacing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;6px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;text-transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;uppercase&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;3.5.2 Styling the product title and product description *&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.product__title&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;line-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--clr-neutral-dark-blue&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--fw-bold&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.product__desscription&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--fw-regular&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Self-explanatory right? maybe just the line height, if you are wondering, which is just the vertical space between lines of text within an element. Try commenting out that property and observe the subtle difference&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.5.3 Styling the product price&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Notice the layout; Flex is our go-to for this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.product__price&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.product__price&lt;/span&gt; &lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="nd"&gt;:first-child&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--fw-bold&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--clr-primary-cyan&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;:first-child&lt;/code&gt; is a &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes"&gt;pseudo-class&lt;/a&gt; selector in CSS used to select and style the first child element within its parent element.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;3.5.4 Styling the button *&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;inherit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;.5rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt; &lt;span class="m"&gt;1.5rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--clr-primary-cyan&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--clr-white&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--fw-bold&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c"&gt;/* flexing because of the icon */&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inline-flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;.5rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next is to set the hover and focused state&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="nd"&gt;:focus&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--clr-primary-cyan-dark&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For visual accessibility on tab-focus, it is best to set the focused state to a bit different style.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* Clearly visible focus outline for accessibility on tab focus */&lt;/span&gt;
&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="nd"&gt;:focus&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;outline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--clr-primary-cyan-dark&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;outline-offset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MYxYNODv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pwyzj7g1n7js73lfjjtb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MYxYNODv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pwyzj7g1n7js73lfjjtb.jpg" alt="Image description" width="800" height="349"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.0 Responsiveness / Media Query&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7PoNYRdj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rurmryyopn56jol2ihwx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7PoNYRdj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rurmryyopn56jol2ihwx.png" alt="Image description" width="779" height="553"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have styled for mobile; to make it responsive, we need to style for desktop&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.1 little adjustments&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;go to the responsive mode of your browser. Right-click and choose inspect or the command key &lt;code&gt;ctrl/cmd&lt;/code&gt; + &lt;code&gt;shift&lt;/code&gt; + &lt;code&gt;i&lt;/code&gt;. Try expanding the screen; you will notice how the elements are stretched beyond imagination😀.&lt;/p&gt;

&lt;p&gt;what if we can tell our product that, "hey product card, don't go beyond this size in width" That would be like saying, your maximum width is this. &lt;/p&gt;

&lt;p&gt;Notice this is different from saying your width is this, else the product card will maintain only one width, but a max width is a saying: hey, you can increase or decrease as much as you want but don't go beyond this width&lt;/p&gt;

&lt;p&gt;So, let's go back to our product container and apply this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.product&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="c"&gt;/* previous code */&lt;/span&gt;
    &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;38.125rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, try resizing in responsive mode again; you will notice that at a given width the product card stops growing and becomes intact.&lt;/p&gt;

&lt;p&gt;Let's make another little adjustment. We said column, right? From the above image, we can either use flex or grid.&lt;/p&gt;

&lt;p&gt;If we use flex, fine! but we will have to set &lt;code&gt;flex-direction&lt;/code&gt; to column (another extra line we do not want). But if we use &lt;code&gt;grid&lt;/code&gt; the layout remains the same, and we will only need to declare for column template. &lt;/p&gt;

&lt;p&gt;Moreso, Choosing Grid over Flex for equally-sized containers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Grid allows direct and simple definition of equal-width columns/rows.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Flex might need additional lines of code (like flex-grow or percentage calculations) to achieve equal widths for multiple containers, making it less straightforward than Grid.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.product&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="c"&gt;/* previous code */&lt;/span&gt;
    &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;38.125rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6.2 Determining the breaking point&lt;/strong&gt;&lt;br&gt;
Notice that in the desktop view, we have two columns. Now switch back to the responsive mode and try resizing again; it will get to the point where the design looks off and is ready for a 2-column layout.&lt;/p&gt;

&lt;p&gt;At around 600 pixels, the design started looking a bit off, so a good point to break the layout!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.3 Media query&lt;/strong&gt;&lt;br&gt;
Having determined the breaking point, lets set a media query for that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* Media query for screens with a MINIMUM width of 600px */
@media screen and (min-width: 600px) {
  /* Styles for screens larger than 600px width */


}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;why use min-width?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The logic is simple. We are styling for a screen size of a minimum of 600 pixels. That is the screen size starting from 600px upward.&lt;/p&gt;

&lt;p&gt;For more info on media query, visit the MDN docs &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Media_queries"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.4 Media Query for the images&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Aren't we lucky? recall our mark-up for the images&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;      &lt;span class="c"&gt;&amp;lt;!-- Product Image --&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;picture&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;source&lt;/span&gt; &lt;span class="na"&gt;srcset=&lt;/span&gt;&lt;span class="s"&gt;"images/image-product-desktop.jpg"&lt;/span&gt; &lt;span class="na"&gt;media=&lt;/span&gt;&lt;span class="s"&gt;"(min-width:600px)"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"./images/image-product-mobile.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Gabrielle Essence Eau De Parfum Bottle"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/picture&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we already set an alternate image to be displayed at screen size of 600 pixels. Else, if we wrapped two &lt;code&gt;img&lt;/code&gt; elements in a div, we would have to toggle between hidden and display for the mobile and desktop image.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.5 Media query for the product container&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is as simple as it gets. We just need to set it to two columns and that's all.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* Media query for screens with a MINIMUM width of 600px */&lt;/span&gt;
&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="n"&gt;screen&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;min-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;600px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/* Styles for screens larger than 600px width */&lt;/span&gt;

  &lt;span class="nc"&gt;.product&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="py"&gt;grid-template-columns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="n"&gt;fr&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="n"&gt;fr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;.5rem&lt;/span&gt; &lt;span class="m"&gt;1.5rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also make a little adjustment to the button.&lt;/p&gt;

&lt;p&gt;And y'all, that's all😀.&lt;/p&gt;

&lt;p&gt;Sorry, I lied; we are not done.&lt;/p&gt;

&lt;p&gt;Recall this?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;        &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;aria-label=&lt;/span&gt;&lt;span class="s"&gt;"Add Gabrielle Essence Eau De Parfum to Cart"&lt;/span&gt; &lt;span class="na"&gt;data-icon=&lt;/span&gt;&lt;span class="s"&gt;"shopping-cart"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Add to Cart&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;  

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I said we would talk about it. &lt;/p&gt;

&lt;p&gt;Note that this will achieve the same result as what we already have.&lt;/p&gt;

&lt;p&gt;This HTML code represents a button element designed to add a product to a shopping cart. Here's an explanation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt;: This is an HTML button element used for user interaction, likely triggering an action such as adding an item to a shopping cart.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;aria-label="Add Gabrielle Essence Eau De Parfum to Cart"&lt;/code&gt;: The &lt;code&gt;aria-label&lt;/code&gt; attribute provides an accessible label for the button, specifying the text to be announced by screen readers ("Add Gabrielle Essence Eau De Parfum to Cart"). This attribute enhances accessibility, ensuring users relying on assistive technologies understand the button's purpose.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;data-icon="shopping-cart"&lt;/code&gt;: This is a &lt;code&gt;data&lt;/code&gt; attribute (&lt;code&gt;data-icon&lt;/code&gt;) used to store custom data associated with the button. In this case, it contains the value "shopping-cart," which might be utilized by JavaScript or CSS to display a shopping cart icon associated with the button, improving its visual representation or functionality.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Add to Cart": This text serves as the visible label inside the button, informing users that clicking it will add the product to the cart.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Similar to the previous code,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;aria-label=&lt;/span&gt;&lt;span class="s"&gt;"Add Gabrielle Essence Eau De Parfum to Cart"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"images/icon-cart.svg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
          Add to Cart
        &lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this HTML snippet creates a button for adding a specific product to a shopping cart, ensuring accessibility through the &lt;code&gt;aria-label&lt;/code&gt; attribute and potentially utilizing the &lt;code&gt;data-icon&lt;/code&gt; attribute to associate the button with a shopping cart icon for improved visual representation or interaction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus Tip
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Difference between Padding and Margin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine your content—text, images, or anything inside a box in your web page—as a picture you're hanging on a wall.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Padding&lt;/strong&gt; is like the space between the picture frame and the actual picture. It's the room you give between the content and the border of the box that holds it. More padding means more space between the content and the edge of its container.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Margin&lt;/strong&gt;, on the other hand, is the space between the picture's frame and the next picture or wall's edge. It's the gap between the box that holds your content and the other elements nearby. More margin means more space between your content's box and the surrounding elements or boundaries.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In short:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Padding&lt;/strong&gt;: Space between the content and its container's border.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Margin&lt;/strong&gt;: Space between the container (or content's box) and nearby elements or boundaries.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Building a product preview card involves structuring HTML, applying CSS styles, and ensuring responsiveness. We've covered the basics here, but remember, practice and experimentation are key to mastering frontend development!&lt;/p&gt;

&lt;p&gt;And that's a wrap! Happy coding and creating awesome product cards!&lt;/p&gt;

&lt;p&gt;`&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>css</category>
      <category>webdev</category>
      <category>responsivedesign</category>
    </item>
  </channel>
</rss>
